Swing: How do I set a component height to the container's height?

前端 未结 3 1283
隐瞒了意图╮
隐瞒了意图╮ 2021-01-19 21:30

I want to make a component to occupy the maximumAvailableHeight of the Container. In the code that I have pasted below for example, I have made the root frame to be 800,600.

3条回答
  •  独厮守ぢ
    2021-01-19 22:11

    There are a number of layout managers that would accomplish this--GridLayout (1x1 grid), GridBagLayout, perhaps BorderLayout.

提交回复
热议问题