Answer the question
In order to leave comments, you need to log in
How to change the size ratio of elements in Swing?
For example, I have a main JPanel that contains two more JPanels (top and bottom).
And I want the top to be, for example, 2/3 of the main one, and the bottom 1/3, so that when the window is resized, the sizes of my panels also change?
Answer the question
In order to leave comments, you need to log in
Read about layout managers. If you describe everything in code, then look towards GridBagLayout. If you use visual ui editors, then there will most likely be SpringLayout.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question