简体   繁体   English

Eclipse JavaFX Scene Builder将ButtonBar或分组按钮添加到GUI

[英]Eclipse JavaFX Scene Builder add ButtonBar or grouped buttons to GUI

I building a desktop app in Eclipse Oxygen.1a Release (4.7.1a) using JavaFX, which will be my first. 我使用JavaFX在Eclipse Oxygen.1a Release(4.7.1a)中构建了一个桌面应用程序,这将是我的第一个。 I have created a file called PersonOverview.fxml and I have added the following code to my code; 我创建了一个名为PersonOverview.fxml的文件,我在代码中添加了以下代码;

<ButtonBar>
    <buttons>
        <Button text="New" ButtonBar.buttonData="LEFT" />
        <Button text="Save" ButtonBar.buttonData="RIGHT" />
    </buttons>
</ButtonBar>

JavaFX Scene Builder 2.0 does not seem to recognize the element - ButtonBar JavaFX Scene Builder 2.0似乎无法识别元素 - ButtonBar

I am wondering if there is an alternative to this. 我想知道是否有替代方案。 I would like to add a group of buttons to my GUI at the very bottom right of the GUI. 我想在GUI的最右下方的GUI中添加一组按钮。 Something like this; 像这样的东西;

分组按钮

SceneBuilder 2.0 was the latest release from Oracle and it was before Java 8u40, which means that it doesn't contain controls like ButtonBar or Spinner that were added in 8u40. SceneBuilder 2.0是Oracle的最新版本 ,它早于Java 8u40,这意味着它不包含8u40中添加的 ButtonBarSpinner等控件。

To be able to work with fully JavaFX 8/9 compatible fxml files, you need SceneBuilder from Gluon. 为了能够使用完全兼容JavaFX 8/9的fxml文件,您需要Gluon的SceneBuilder。 You can download your binary from here . 您可以从这里下载二进制文件。

The project is still open source, you can find it here , it is not only updated with the latest changes in JDKs 8 and 9, but also new features are being included. 该项目仍然是开源的,你可以在这里找到它,它不仅更新了JDK 8和9的最新变化,而且还包括新功能。

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

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