COPYRIGHT RESERVED 2009 BY MAX TSAI



Visit Max Tsai at Facebook | Twitter | atom

Wednesday, May 9, 2007

JavaFX - Quick Start on Eclipse ..

Doing JavaFX on Eclipse:

  1. Install openjfx plugin for Eclipse
    (Help > Software Updates > Find and Install)
    URL
    http://download.java.net/general/openjfx/plugins/eclipse/site.xml
  2. New Java Project
  3. New JavaFX file HelloWorld.fx
  4. Type in the sample code from openfx.dev.java.net
    import javafx.ui.*;

    class HelloWorldModel {
    attribute saying: String;
    }

    var model = HelloWorldModel {
    saying: "Hello World"
    };

    var win = Frame {
    title: bind "{model.saying} JavaFX"
    width: 200
    content: TextField {
    value: bind model.saying
    }
    visible: true
    };
  5. Right click on the project and Run As JavaFX Application (double click)
  6. Add argument: HelloWorld
  7. Here we go:

3 comments:

Anonymous said...

I could not see "Run As JavaFX"

I ccould only see "Run as Java Application" and "Run as Applet"

Anonymous said...

make sure to have the openjfx for eclipse plug in installed.

Anonymous said...

Also I had to reboot eclipse before I could see the "Run As JavaFX" option.

Post a Comment