Reputation: 1313
I want this:
My frame is a GridLayout (3,2), and all I can have is this:
I put the button in a panel, I think it's easier. But how can I change the size of the grid?
Upvotes: 2
Views: 740
Reputation: 51445
As you've seen, GridLayout makes all of the cells in a grid the same size.
Your layout consists of two JPanels inside of a main JPanel.
The main JPanel will have a BoxLayout with a Y axis.
The panel JPanel will have a GridBagLayout.
The button JPanel will have a FlowLayout.
Upvotes: 0