Java:GridLayout添加到特定单元格
例如,如何将数据添加到特定单元格([*] 表示单元格): [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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.