aspose file tools*
The moose likes Applets and the fly likes Applet starts but only shows white screen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet starts but only shows white screen" Watch "Applet starts but only shows white screen" New topic
Author

Applet starts but only shows white screen

jeff krystyan
Greenhorn

Joined: Apr 02, 2012
Posts: 9
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
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
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.


Ping & DNS - updated with new look and Ping home screen widget
 
wood burning stoves
 
subject: Applet starts but only shows white screen
 
Similar Threads
I'm fazed by a nullpointererror I can't get rid of
Moving an object such as an arc.
keyevent not working in applet?
why can't I access my variable?
When I add sound it slows Swing way down