Reputation: 5409
I want to create a GUI in Swing which contains two vertical sections:
+-----------------------+
| labels,textfields |
| and buttons |
+-----------------------+
| |
| chart display |
| |
| |
+-----------------------+
I want the first section to take about 30% of the vertical space and the second about 70%. How can I achieve this with Java Swing?
Upvotes: 2
Views: 272
Reputation: 168825
See also JSplitPane.setDividerLocation(int)
& How to Use Split Panes.
Upvotes: 3
Reputation: 5919
I would recomend using GridBagLayout
for the cases in which you want to controll the size of the layout's components as it allows to put weights on the components.
Upvotes: 3
Reputation: 32391
Use a layout manager like BorderLayout
. The top one would go to BorderLayout.NORTH
, the bigger one to BorderLayout.CENTER
.
Upvotes: 2