This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Quick question on Applet GUI not showing up Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Quick question on Applet GUI not showing up" Watch "Quick question on Applet GUI not showing up" New topic
Author

Quick question on Applet GUI not showing up

David Crossett
Ranch Hand

Joined: Feb 05, 2003
Posts: 102
Every once in awhile when creating applets, my GUI components don't show up. The last time this happened, I just created a layout manager (FlowLayout) and things worked. But my code is identical and when I run it, nothing shows up. What am I missing?

thanks!


David Crossett
-nothing important to say, but learnin' plenty-
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34


The default implementation of paint() is responsible for rendering the entire visual appearance of the applet and all its component children. You've overridden it to do precisely nothing, instead. While this will certainly help performance some, and, as you've noted, it has a certain Zen esthetic to it , if you want the components to actually appear, you ought to remove that paint() override altogether.


[Jess in Action][AskingGoodQuestions]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Quick question on Applet GUI not showing up