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

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet starts but only shows white screen" Watch "Applet starts but only shows white screen" New topic

Applet starts but only shows white screen

jeff krystyan

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

Joined: Mar 22, 2005
Posts: 39575
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
I agree. Here's the link:
subject: Applet starts but only shows white screen
Similar Threads
why can't I access my variable?
When I add sound it slows Swing way down
Moving an object such as an arc.
I'm fazed by a nullpointererror I can't get rid of
keyevent not working in applet?