What is the correct way to set size of elements of GUI?

Posted by Roman on Stack Overflow See other posts from Stack Overflow or by Roman
Published on 2010-03-26T12:50:38Z Indexed on 2010/03/26 12:53 UTC
Read the original article Hit count: 117

Filed under:
|
|
|
|

I am using swing to create my GUI. J have a JFrame containing one main JPanel which, in its turn contain several JPanels which, in their turn, contain buttons.

I would like to set certain sizes to mu buttons and JPanels. How does it work? Should I set sizes of my buttons and then the size of the JPanel and the JFrame will be set according to the buttons sizes? Or it works in the opposite direction? I set size for the JPanel and the size of the buttons will be set automatically?

© Stack Overflow or respective owner

Related posts about java

Related posts about swing