Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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: 41600
    
  55
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 - my free Android networking tools app
 
 
subject: Applet starts but only shows white screen