Java:GridLayout添加到特定单元格

发布于 2024-10-04 02:45:14 字数 113 浏览 1 评论 0原文

例如,如何将数据添加到特定单元格([*] 表示单元格): [J按钮1] [J按钮2] [] [] [JButton3]

或者有没有更好的解决方案而不是使用空布局来获得类似的结果 - 给出一个间隙。

how to add data to specific cell for example ([*] indicates a cell):
[JButton1]
[JButton2]
[]
[]
[JButton3]

Or is there any better solution rather than using null layout to get similar result - giving a gap.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

倦话 2024-10-11 02:45:14

JPanel 的 GridLayout 每个都有一个 CardLayout。当您希望某些内容出现在特定的 x,y 位置时,请将其添加到 JPanel 并显示该卡。

GridLayout of JPanels each with a CardLayout. When you want something to appear in a particular x,y position, add it to the JPanel and show that card.

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