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

前端 未结 4 1460
北海茫月
北海茫月 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 08:01

    If you can setResizeable( false ) on the top level frame you can then set your layout manager to null and hard code each location and size via setBounds. This is how I would do it (contingent on resizing of course).

提交回复
热议问题