• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Positioning JPanels in a JPanel

 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way I can create 4 JPanels inside an outer JPanel, however
initially only the top JPanel is visible. Then when an event occurs the others appear 1 directly below the other with no gaps?

Thanks.
 
Daniel Mayer
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just put the panels in the appropriate layout, for example a BoxLayout, and hide() the three lower panels initially. Call show() on them once you want them to be visible.
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic