Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Quick question on Applet GUI not showing up

 
David Crossett
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic