The moose likes Swing / AWT / SWT / JFace and the fly likes Nested Layouts Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "Nested Layouts" Watch "Nested Layouts" New topic
Author

Nested Layouts

Erik Dark
Ranch Hand

Joined: Jan 28, 2002
Posts: 107
I tried to nest 2 GridLayouts in a BorderLayout which was nested in another BorderLayout but can't seem to make it work....
Does anyone have suggestions?
Erik Dark
Joe Gilvary
Ranch Hand

Joined: May 11, 2001
Posts: 152
It should work. I have nested lots of things in
GridBagLayout before.
Can you post an example of your code?
Thanks,
Joe
Erik Dark
Ranch Hand

Joined: Jan 28, 2002
Posts: 107

The labels should be besides the scrollbars in the south...
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
You didn't place anything in the south. You create a panSouth panel add it to your main layout but do not add anything to it. You place 2 items in the center. I have reformatted your code a little and placed some comments in it. Updated to what I think you wanted.

[ January 29, 2002: Message edited by: Paul Stevens ]
Erik Dark
Ranch Hand

Joined: Jan 28, 2002
Posts: 107
Thanks a lot Paul!
I'm quite new to awt/swing and puzzled my brain out to get what you seem to have done in...
It's not only the result but I see where I was mistaken. Thanks.

Erik Dark
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
If you wanted more normal sized buttons, you could place a panel with vertical box layout in the east and place your buttons on it. You were close.
 
IntelliJ Java IDE
 
subject: Nested Layouts
 
Threads others viewed
help with Layout managers
How to make components stick togather
GridbagLayout
complex dialog layout?
best layout to use
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture