• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question about JApplets and JPanels

 
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could try using JAR files with your class files inside.
 
reply
    Bookmark Topic Watch Topic
  • New Topic