gpt4 book ai didi

java - 在 GridBagLayout 中设置 columnWidth 和 rowHeight

转载 作者:塔克拉玛干 更新时间:2023-11-01 22:30:23 24 4
gpt4 key购买 nike

如何在GridBagLayout中设置columnWidth和rowHeight?是 gridWidth 和 gridHeight 吗?

enter image description here

如何动态指定列宽?

最佳答案

根据JavaDocs

网格高度

Specifies the number of cells in a column for the component's display area. Use REMAINDER to specify that the component's display area will be from gridy to the last cell in the column. Use RELATIVE to specify that the component's display area will be from gridy to the next to the last one in its column.

gridheight should be a non-negative value and the default value is 1.

网格宽度

Specifies the number of cells in a row for the component's display area. Use REMAINDER to specify that the component's display area will be from gridx to the last cell in the row. Use RELATIVE to specify that the component's display area will be from gridx to the next to the last one in its row.

gridwidth should be non-negative and the default value is 1.

所以,如果你想指定一个组件将跨越的行数或列数,那么,是的

关于java - 在 GridBagLayout 中设置 columnWidth 和 rowHeight,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12444092/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com