JavaFX Series (PART 1) - Setting up NetBeans for JavaFX Development 07-24-2016, 02:42 PM
#1
![[Image: javafxlogo.png]](http://www.kentaroallen.com/img/javafxlogo.png)
Welcome to Part 1 of my JavaFX Series in which we will be getting familiar with JavaFX and how to develop GUI Applications with it.
When I started Java, I usually made Desktop Applications using Swing but it was really a pain in the ass, I was assigned to make a Management system as my semester project (God I hate Management systems now
![Tongue Tongue](https://sinister.ly/images/smilies/set/tongue.png)
Right after our project submission I found out about JavaFX, when I took some tutorials I was like damn this was the thing I needed for the project. MVC implementation is so much easy. Plus in Swing there was whole lots of mesh code which made it really hard to take care of while in JavaFX it was neat and clean. And the best part is that JavaFX supports skinning using CSS. You can change every aspect of your user interface as you'd like, How cool is that
![Biggrin Biggrin](https://sinister.ly/images/smilies/set/biggrin.png)
So here are some advantages that JavaFX offers:
Code:
Easy MVC Implementation
Better Event Handling
Animations Supported
Eye Candy Factor
CSS Styling
Consistent Controls
Special Effects
Clean Code
So to setup our JavaFX development environment, you'll have to download the following
NetBeans IDE -> https://netbeans.org/downloads
JDK 8 -> http://www.oracle.com/technetwork/java/j...index.html
Gluon Scene Builder -> http://gluonhq.com/labs/scene-builder/
We are using JavaFX 8 as we have JDK 8, JavaFX 8 has lots of new improvements.
FXML & Scene Builder
FXML is an XML based language which is used to define the user interface of your JavaFX application. Initially on NetBeans, when you create a JavaFX project, you will be presented with a .fxml file inside which there is nothing but tags that define your GUI. Now you can't create your GUI blindly by editing the tags, you need some kind of a medium that will visually display the changes that you do to your GUI. This is where Gluon's Scene Builder comes in.
With the scene builder you no longer need to worry about the FXML file, all the editing you will do to your GUI will be done with the Scene Builder and it's totally Drag n Drop. Now we just have to setup Scene Builder with NetBeans so that when you click on the FXML file, instead of displaying code, Scene Builder will pop up and you can make the changes there.
Scene Builder with NetBeans Config
You must have installed both NetBeans and Scene Builder, so in order to config them, First start NetBeans.
After starting NetBeans go to Tools > Options > Java > JavaFX
There, just select the path of your Scene Builder directory. Here's a screenshot
![[Image: netbeanssb.png]](https://procurity.files.wordpress.com/2016/06/netbeanssb.png)
Press Apply and OK, You are all done for the config part.
That's all for the first part of configuring Scene Builder with NetBeans, Now in the next part we will see more details about JavaFX like Stage, Controller Class etc.
Original link to the post: Procurity
PART 2: JAVAFX PART 2