Can you set a permanent size for a JPanel inside of a JFrame?

前端 未结 4 1495
北海茫月
北海茫月 2021-01-21 07:43

My current problem is that I have a JFrame with a 2x2 GridLayout. And inside one of the squares, I have a JPanel that is to display a grid. I am having a field day with the java

4条回答
  •  粉色の甜心
    2021-01-21 07:58

    I have had success solving problems like these using TableLayout which is a third party layout manager. You will need to download it and read the tutorial but the key would be to set the justification to CENTER when adding the JButtons to their positions in the layout.

提交回复
热议问题