File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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: 41106
    
  45
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Applet starts but only shows white screen
 
Similar Threads
I'm fazed by a nullpointererror I can't get rid of
keyevent not working in applet?
why can't I access my variable?
Moving an object such as an arc.
When I add sound it slows Swing way down