Forums Register Login

Question about JApplets and JPanels

+Pie Number of slices to send: Send
Hi

I've just created my JApplet(jap.java), which uses an inner-class(Drawer.java) that extends
JPanel to do the drawing part of applet.
In my IDE(netbeans 3.5) the applet works fine.

Annoyingly, when trying to upload the inner-class(Drawer.java) class file to Yahoo Geocities(web site creator), it won't upload, I think thats because of the $ in jap$Drawer.class

This is so frustrating, I doubt anyone knows how to do this, if its possible at all.
The other options I can think of are:
1. Keep the Drawer.java class as a separate class from jap.java, not sure if I can do this, I had problems when I just tried it.
2. Just use one class, the problem here is that to use the paintComponent
method, I need to extend JPanel class, but obviously I can't extend JApplet and JPanel at the same time. So I was wondering if it was possible to implement an interface in order to override paintComponent.

NB If you wondered why I'm not just extending Applet and using paint(), its because the screen keeps flashing when I call repaint().

Hope someone can shed some light on any part of this. Thanks
+Pie Number of slices to send: Send
You could try using JAR files with your class files inside.
Do Re Mi Fa So La Tiny Ad
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 612 times.
Similar Threads
repaint() not erasing/redrawing strings?
JApplets, can't seem to draw anything
Why is screen flashing when I call repaint()?
How to properly create an applet with an Input field and some shapes.
My Games Flashing!!
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 04:27:39.