*
The moose likes Swing / AWT / SWT and the fly likes Positioning JPanels in a JPanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Positioning JPanels in a JPanel" Watch "Positioning JPanels in a JPanel" New topic
Author

Positioning JPanels in a JPanel

Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
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

Joined: Sep 09, 2004
Posts: 103
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

Joined: Jan 14, 2004
Posts: 1535
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Positioning JPanels in a JPanel
 
Similar Threads
What's difference between JPanel and JComponent?
How to display the borders in Panels
Linking two JPanels with a JButton
Layout
Urgent!!!Want to add different panels in different rows..