在 Java 中更改网格大小
在 Swing 中,使用网格布局,每个网格具有相同的大小..
是否可以根据需要更改网格大小以使它们不均匀...?
In Swing, using Grid Layout, each grid has same size..
is it possible to change teh grid size to make them uneven according to need... ??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不,
你能做的就是嵌套布局。例如,如果您需要将一个单元格拆分为多个块。否则,您应该使用其他布局,例如 GridBagLayout。
No.
What you can do, is to nest layouts. For example, if you need to split one cell into a number of chunks. Otherwise you should use some other layout such as the GridBagLayout.
根据设计,网格布局使所有行/列具有相同的大小。您必须切换到另一个布局管理器才能拥有大小不等的网格(例如GridBagLayout)。
By design gridlayout does all rows/columns the same size. You have to switch to another layout manager to have non-equally sized grids (e.g. GridBagLayout).
不,但在我看来,网格布局是一场灾难,不应该使用。
如果您想生成某种表单,例如具有不同大小列的布局,请使用表单布局,可在此处找到:http ://www.jgoodies.com/freeware/forms/
No But in my opinion gridlayout is a disaster and shouldn't be used.
If you want to produce some sort of form like layout with different sized columns use the form layout, found here: http://www.jgoodies.com/freeware/forms/