在VBox中添加按钮之间的空间 [英] Adding space between buttons in VBox

查看:142
本文介绍了在VBox中添加按钮之间的空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组按钮:

VBox menuButtons = new VBox();
menuButtons.getChildren().addAll(addButton, editButton, exitButton);

我想在这些按钮之间添加一些间距,而不使用CSS表格。我认为应该有办法解决这个问题。

I want to add some spacing between this buttons, without using a CSS sheet. I think there should be a way for this.

setPadding();是为了盒子里的按钮。
setMargin();应该是Box本身。但是我没有找到按钮间距的方法。

setPadding(); is for the Buttons in the Box. setMargin(); should be for the Box itself. But I didn't find a way for the spacing between the buttons.

我很高兴有任何想法。 :)

I'm glad for any ideas. :)

推荐答案

VBox 支持间距:

VBox menuButtons = new VBox(5);

menuButtons.setSpacing(5);

这篇关于在VBox中添加按钮之间的空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆