Link to home
Start Free TrialLog in
Avatar of nhay59
nhay59

asked on

swing gui layout issues - any help or advice?

Hi,

I'm currently writing a swing gui, which requires the following characteristics:

- a menu bar at the top of the frame
- 3 panels, with the top panel the largest of the three panels, the middle panel a set height, and the bottom panel large enough to fit a textfield and 2 buttons
- resizeable, and maintain the predefined size proportions for each panel

Which layout manager is best to use to achieve the above characteristics?

Any advice or help is appreciated.

Thanks
Avatar of sciuriware
sciuriware

BorderLayout.

;JOOP!
The menu is attached to the mainframe and independent of the layout.

Put the 3 panels at Notrh, Centre and South resp.

;JOOP!
North of course.
Avatar of nhay59

ASKER

Hi,

Thanks for the reply. Is it possible to define set sizes for the panels, in order to stop the center panel from being the largest one?

Whenever I've used BorderLayout before, the North and South panels have been big enough to fit all the components and the center panel has simply filled all the remaining space. I need the top/North panel to be the largest, in order to fit images that are chosen from the open item within the menu bar.

Thanks for the help.
ASKER CERTIFIED SOLUTION
Avatar of sciuriware
sciuriware

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nhay59

ASKER

Hi,

Thanks for the replies. I've managed to get it to work with a combination of both possible answers. I put the main image viewing panel as Center within a BorderLayout, and used a split pane for the bottom two panels, with a position as South in a BorderLayout.

Thanks for the help.
Great! :)