• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet starts but only shows white screen

 
jeff krystyan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey all, trying to figure out something...

my program will compile fine and the applet will start but the appletviewer itself only shows up as a white screen. Can you help?

I'm using textpad. Here's the code. I didn't notate it but it is just a practice code to demonstrate key events. The program moves a square to the right.



 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're using Swing components, then the class should extend JApplet, not Applet (which is for AWT applets).

Also, the main method is used by applications, not by applets. Move the code that's in there into the init method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic