David
David

Reputation: 81

Integrating Gluon Scene Builder into Eclipse?

I've been figuring out how to integrate Gluon Scene Builder into my IDE of choice and decided it would be a good share with the Stack Overflow community for those of you who have had trouble with this in the past. Keep in mind this is for those who have had prior experience with JavaFX and Gluon Scene Builder, minimal at least.

Upvotes: 1

Views: 12785

Answers (4)

notes-jj
notes-jj

Reputation: 1557

Eclipse integration with Gluon Executable JAR on Windows

Parameters/Preconditions used in this example:

Step by Step

  • Download "Executable JAR" from Gluon to folder c:\example\.

    http://gluonhq.com/products/scene-builder/#download

  • Create Batch File "c:\example\scene_builder.bat" and add the following line:

    "java.exe" -jar "%~dp0\scenebuilder-all-8.3.0-all.jar" %*
    
  • Double click batch file to test it, SceneBuilder should start

  • In Eclipse open Window - Preferences - JavaFX

    SceneBuilder executable: c:\example\scene_builder.bat

  • Right click on fmxl File in Eclipse and click Open in ScenenBuilder

Comments

  • "java.exe"

    If Java is not installed in the default way, specify the whole path to executable in quotation mark. "C:\Program Files\Java\jre1.8.0_131\bin\java.exe"

  • %~dp0\

    Will open SceneBuilder JAR in the directory of the batch file

  • %*

    Will pass all command line arguments passed to the batch file to SceneBuilder call

Upvotes: 5

shuishoudage
shuishoudage

Reputation: 21

I use IntelliJ IDEA IDEA to do some JAVA GUI application. It embeds the scene builder. However, you have to install scene builder as well. Here is the screen of it: 1. build a javafx application first 2. find your-application.fxml, then go to bottom left, there is a button Scene builder. (if you haven't install scene builder, it will ask you the path of your scene builder) Scene Builder

Upvotes: 0

fcreav
fcreav

Reputation: 360

You have to download scenebuilder. Once downloaded you need to move it as it is downloaded in a strange place.

You then need to add an external jar as a library.

If you have already got fx support in eclipse set up. Create a new java fx project. Then create a new fxml file. You should now be able to open the fxml file with scene builder by right clicking on it.

I cannot do it better than this guy on the video tutorial. You obvisouly need java fx support first which is covered in tutorial 2-3.

http://m.youtube.com/watch?v=2j-e1CHsqsE

Upvotes: 0

David
David

Reputation: 81

I haven't "scene" any posts directly addressing integration of SceneBuilder as a tutorial so I figured I would set it nice and simple since there were a few questions roaming around.

THIS GUIDE IS FOR ECLIPSE AND USES GLUON'S SCENEBUILDER

Note this guide is intended for those lightly to moderately experienced with JavaFX as an application builder

//INTELLIJ AND NETBEANS WILL COME LATER PER DEMAND FOR EACH

Alright guys, here we go.

Step 1) Open up your Eclipse IDE(preferably with JavaFX installed prior to installing SceneBuilder) and a web browser of your choice.

  • You will need elements of JavaFX in order to properly implement SceneBuilder.

Step 2) Click or browse with this link: http://gluonhq.com/open-source/scene-builder/

  • Select your current operating system on which you will be installing SceneBuilder.
  • SceneBuilder's default location on Windows is in C:\Users\YourUserFolder\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Gluon, but of course it is more than possible and recommended to change the path while downloading.

Step 3) Once SceneBuilder is downloaded and installed, close SceneBuilder and find the .exe file on your PC(or Mac) where you chose to install it to or in it's default location.

  • Copy SceneBuilder.exe's file path. For example if you allowed SceneBuilder to install in it's default location, the file path would be: C:\Users\YourUserFolder\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Gluon\SceneBuilder.exe

Now we need to associate FXML files with SceneBuilder

Step 4) Associate FXML with SceneBuilder.

  • Still inside Eclipse, click Windows at the top > Preferences > search "File Associations"

  • Browse for the SceneBuilder.exe file path we copied earlier and click OK.

Step 5) Return to the Eclipse IDE and open up a JavaFX Project and name it "test".

  • File > New > Other > JavaFX Project OR (Ctrl + N) > JavaFX Project

    • Go into the src folder of test project.

    • Create an FXML file: test > src > application > New > Other > New FXML Document

    • Name your FXML file "testfx"

Congratulations, upon firing up your FXML document, you should be billed with a SceneBuilder window. If not you may not have associated FXML documents correctly.

Now how to implement the code is for a different time. For now this tutorial is all I've got within me! If you guys found this helpful, shoot me a pm and let me know! I appreciate your feedback and would like to be able to build upon this greatly.

Thanks guys,

Happy Programming!

Upvotes: 6

Related Questions