Today I am going to teach you how to install JavaFX in Eclipse.  Try to install the latest version of Java on your computer. You can find it here : Latest Java Version

And then you can check it by opening your command prompt and writing java -version

java version

The next step is to open Eclipse -> Help -> Install New Software

install java fx

It will open a new window on your eclipse and will ask you for a name and a location where to find this new software that you’re about to install.

In the name field enter : ec(fx)lipse

In the location field enter this link : http://download.eclipse.org/efxclipse/updates-released/2.3.0/site/

Here are all the .jar files that are needed to install Java FX on Eclipse.

In case you get stuck here is an illustration of this step :

JavaFX

After selecting the 2 components proceed with the installation and restart Eclipse so the configurations can take effect. Now lets take a look what happens after we install it. When you create a New Project , there should also be the option for creating a JavaFX project.

new project

After selecting JavaFX Project , click Next , type the project name and you’re ready to go.

Now your project will appear in the projects section on the left. Open it, go to src and you will notice that there is a package named application. And inside there is a file named : Main. This is a basic Java FX class that Eclipse created for us when we installed it.Compile it and you will see a blank window.

Main.java program

package application;
  
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;


public class Main extends Application {
  @Override
  public void start(Stage primaryStage) {
    try {
      BorderPane root = new BorderPane();
      Scene scene = new Scene(root,400,400);
      scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
      primaryStage.setScene(scene);
      primaryStage.show();
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
  
  public static void main(String[] args) {
    launch(args);
  }
}

 

Now, you are good to go and create amazing applications with Java FX. In the next tutorials you will find lots of JavaFX examples.

If you need to get started with Java, you can read this tutorial : Getting Started With Java 

If you have any questions feel free to comment.

7 COMMENTS

  1. Hello would you mind sharing which blog platform you’re using? I’m looking to start my own blog in the near future but I’m having a hard time deciding to go with Drupal.

  2. Thank you for every other magnificent post. The place else may anyone get that kind of information in such an ideal way of writing? I’ve a presentation next week, and I’m at the look for such information.

  3. Hi! Do you know if they make any plugins to help with Search Engine Optimization? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good success. If you know of any please share. Kudos!

  4. I simply want to mention I am newbie to weblog and seriously savored your website. More than likely I’m want to bookmark your site . You absolutely have excellent article content. Many thanks for revealing your blog site.

LEAVE A REPLY

Please enter your comment!
Please enter your name here