跳过一行GridBagLayout [英] Skip a row GridBagLayout
问题描述
我在JFrame上使用GridBagLayout,我希望能够跳过一两行,但是将那些行显示为空白,然后在这些行之后添加一个按钮.我在文档中找不到任何方式可以执行我描述的操作,有人知道我可以执行任何操作吗?
I'm using the GridBagLayout on a JFrame and I'd like to be able to skip a row or two but have those rows show up as blank, and then have a button after those rows. I can't find any way in the documentation to do what I described, does anyone know of any way I can do this?
推荐答案
弄清楚它比添加空组件要干净的多.有一个名为GridBagConstraint
,它允许您选择组件之间的空白.正在以任何方向添加其周围的其他组件.不过,谢谢您的回答!
Figured it out much cleaner than adding empty components... there is a GridBagConstraint
named insets that allows you to choose the white-space between the component you're adding and the other components around it in any direction. Thanks for the answers though!
这篇关于跳过一行GridBagLayout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!