Saturday, October 18, 2008

JavaFX – Getting Started


Alright, here is the blog for the beginner of JavaFX. We generally say it “getting started”

So, right now I suggest you to work with Netbeans 6.1. There is a good amount of code change going to happen soon in JavaFX but never mind. Here we go:

  1. Start Netbeans 6.1. Go into Tools -> Plugin section. Go into Available Plugins, search for JavaFX in the search box. You may see more than this, but whatever comes on the name of JavaFX, install all (I already have it in installed section).


  1. After installation, go into File -> New Project Section. You can see JavaFX now in project section:


  1. Click on Next, It will ask for Project Name. Enter a project name “JavaFXApplication” (this is what I have written) and click finish. You will get something like this:


  1. But the most important thing is what you get on right most side with a caption “Palette” (FX Builder). Here how it looks:


  1. In place of “place your code here”, we need to write our code. So, let’s start with “Drag and Drop” work. First we will make a circle. So, drag a Frame into the code space and then drag a circle in the content section of code.


  1. Before running the code, you can see the preview of output, by clicking on the preview button.


  1. This is how the preview will come:


  1. After you convince with the output, go into the Run Section. Run the application or press F6.

In the next blog, we can discuss on how to use FX builder to make more wise applications like running a ball, making 3D balls, image gallery or something else, depending on the demand :).


Please let me know if there is/are some problem(s) in installation or running the application.If you are not a netbeans user, the you have two option :

- Wise one, download netbeans and start working :).

- Unwise one, we can also work only with javafx preview developer by putting the code in bin folder compiling with javafxc and running with javafx. But then you will not be able to use lot of netbeans features.