简体   繁体   English

JAVA GUI布局-垂直放置6个带有空格的按钮的最佳布局是什么?

[英]JAVA GUI Layout - what is best layout for 6 buttons placed vertically with spaces?

I have been recently creating some GUI's for my program. 我最近一直在为我的程序创建一些GUI。 However for my next GUI I want to know what is the best way to create a frame as follows: 但是对于我的下一个GUI,我想知道创建框架的最佳方法如下:

It will have a title, Hotel Menu and then under it I want it to have 6 buttons placed vertically with spaces in between them. 它将有一个标题,“酒店菜单”,然后在其下我希望它有6个垂直放置的按钮,它们之间有空格。 Wondering what is the best layout I can use to achieve such a thing? 想知道实现该目标的最佳布局是什么?

I have used box layout before, but the buttons were uneven sizes and stuck together. 我以前使用过盒式布局,但是按钮的尺寸不均匀且粘在一起。

What IDE you are using?! 您正在使用什么IDE? You can use NetBeans as IDE, it has the advantage of the classical "click-and-drag" GUI design. 您可以将NetBeans用作IDE,它具有经典的“单击并拖动” GUI设计的优点。 Else, if you want to manually write the coding, the best way is to use Grid Layout. 否则,如果要手动编写代码,最好的方法是使用“网格布局”。 You can read more about it here 您可以在这里了解更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM