Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


Tutorial JavaFX Series (PART 1) - Setting up NetBeans for JavaFX Development filter_list
Author
Message
JavaFX Series (PART 1) - Setting up NetBeans for JavaFX Development #1
[Image: 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 ), Now at that time I wasn't familiar with JavaFX so me and my team went with Swing. We were done making the back end functionalities, as soon as we came to the front end, we were just scratching our heads.  Our idea of implementing MVC went to waste, it took too much of our time and still we couldn't implement it so we went on implementing all the functions behind buttons and stuff (Had no time :-P). After hit and trail method we were done with the majority but the eye candy factor was still lacking, the GUI look of our app was plain dull.

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 Hence I was in regret that I should have found out about JavaFX in the first place.

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]

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
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

Reply

RE: JavaFX Series (PART 1) - Setting up NetBeans for JavaFX Development #2
really thank i'm know study matmatic but this post stop my study..hhh don't warry i have 91 in matmatic..

buddy you say that Fx is easer than swing But till now i used Swing how i come on FX now.

buddy you say that Fx is easer than swing But till now i used Swing how i come on FX now.
(This post was last modified: 08-11-2016, 07:18 PM by Mr.Kurd.)
Die  But Don't Lie
“Oh Abu Dharr! Don’t look at the smallness of the sin but look at the one you disobeyed.” Prophet Muhammad (pbuh)
[Image: p_237m2jx1.png]
Click for Free VPN

Reply







Users browsing this thread: 1 Guest(s)