Hi everyone I have a JFrame which has three components inside.
Initially my goal was to create a design like the following:
when the user would resize the application, everything would be resized as well. So I thought maybe if I used a simple grid layout my problem would be solved, so I decided to do the following:
The tabbed pane will have some panels inside and those panels will follow the grid layout.
the Panel at the bottom will follow the grid layout.
the JFrame will follow the grid layout as well.
Results:
As you can see this is not what I wanted, the buttons are too big and although the application resizes very well:
The buttons resize as well but they remain too big. I would like to be able to set a small size for the buttons(more specifically the panel they are contained in) and when the user resizes the application, the buttons would resize only horizontally never vertically which means that ONLY the tabbed pane would grow bigger vertically. Is this achievable? I searched and found out about gridbaglayout, I started playing a little bit, but I didn't achieve anything. All I managed to do is the following:
seems good, but when I resize this is what I get:
thanks in advance.
I would use BorderLayout
for the content pane. Put the tabbed pane in it using BorderLayout.CENTER
, and the panel of buttons in it using BorderLayout.SOUTH
.