This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Applets and the fly likes Applet will not draw correctly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet will not draw correctly" Watch "Applet will not draw correctly" New topic
Author

Applet will not draw correctly

Kevin Anderson
Greenhorn

Joined: Jan 14, 2013
Posts: 10

Hello all,

I have the following program that, when the applet loads, all I get is a white screen with 4 textboxes. I have even tried commenting everything except for the background line out but it still wont draw the background. Could you please point me in the direction of the error?




Thank you.
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42954
    
  73
Swing applets should override paintComponent, not paint http://docs.oracle.com/javase/tutorial/uiswing/painting/
Kevin Anderson
Greenhorn

Joined: Jan 14, 2013
Posts: 10

Ulf Dittmer wrote:Swing applets should override paintComponent, not paint http://docs.oracle.com/javase/tutorial/uiswing/painting/


It worked. Thank you.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Applet will not draw correctly