在 Java 中更改网格大小

发布于 2024-10-24 05:42:29 字数 71 浏览 7 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

不知所踪 2024-10-31 05:42:29

不,

你能做的就是嵌套布局。例如,如果您需要将一个单元格拆分为多个块。否则,您应该使用其他布局,例如 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.

倒数 2024-10-31 05:42:29

根据设计,网格布局使所有行/列具有相同的大小。您必须切换到另一个布局管理器才能拥有大小不等的网格(例如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).

很酷又爱笑 2024-10-31 05:42:29

不,但在我看来,网格布局是一场灾难,不应该使用。

如果您想生成某种表单,例如具有不同大小列的布局,请使用表单布局,可在此处找到: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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文