简体   繁体   中英

Using JavaFX without e(fx)clipse

I'm trying to get started with JavaFX, using Eclipse with Java 8. However, I'm unable to install e(fx)clipse, and I won't be able to.

For now I'm trying to use the scene builder on it's own. I have created a layout and I can create an FXML file, but Eclipse doesn't seem to know what to do with it. Is there a way to get the Java source code out of the Scene Builder? Or maybe some configuration to Eclipse to make it know what to do with FXML?

FXML are just XML files which are loaded and converted into views. These can be loaded in your application irrespective of whether you have a plugin installed or not. For more information on how to use FXML in your application, go through

You may or may not use FXMLs at all. FXML is just a support added to JavaFX to separate the view from the logic. If you want to you can use plain Java to create views for you application.

Moreover, you can link fxml files in eclipse to open with scene builder by default.

Right click on any FXML file -> Open With -> Other -> External Program -> Browse for Scene Builder application -> Check the box with text "Use it for all *.fxml files"

As of now, there isn't any support to get Java source out of FXML. For more information go through

I recommend you to use JavaFX Scene Builder 2.0

It's great standalone tool where you even can create events for components and copy paste to your code. I use this tool in conjunction with the latest version on Netbeans but you can use it with eclipse too.

This tool can be downloaded from the Oracle website .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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