0

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?

ItachiUchiha
  • 36,135
  • 10
  • 122
  • 176
JJ Ab
  • 492
  • 4
  • 15
  • You can right click on any FXML file -> Open With -> Other -> External Program -> Browse for Scene Builder application -> Tick mark "Use it for all *.fxml files" – ItachiUchiha Nov 08 '15 at 14:00
  • Do you know if its possible to also generate a Java source code out of an fxml? Without using Sharingan – JJ Ab Nov 08 '15 at 14:13
  • Lol, for your second question, you can go through [How to Convert FXML to JAVA](http://stackoverflow.com/questions/15149843/how-to-convert-fxml-to-java) – ItachiUchiha Nov 08 '15 at 14:18
  • 1
    But why would you want to do that? As a beginner you should first stick with the normal ways of working with JavaFX and once you are familiar with the concepts you will probably realize that you were on the wrong track here. – mipa Nov 08 '15 at 14:21

2 Answers2

0

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

Community
  • 1
  • 1
ItachiUchiha
  • 36,135
  • 10
  • 122
  • 176
0

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 .

Pini Cheyni
  • 5,073
  • 2
  • 40
  • 58