Menu Pilihan:
iToonTV Cartoon
(5)
iToonTV Comic
(1)
iToonTV Game
(1)
iToonTV Music
(1)
iToonTV News
(17)
iToonTV Shorts
(3)
Java FX for Eclipse
Installation
Install JavaFX SDK
Download JavaFX SDK for Windows or Mac Os X. Follow the installation instructions.
Install Eclipse
Plugin require Eclipse 3.4 or newer. We recomend downloading Eclipse IDE for Java EE Developers
for Windows or Mac OS X. Then follow the installation instructions.
Install plugin
- Download plugin:
- Unzip into eclipse installation directory
- There should be new files in
ECLIPSE_ROOT/plugins
andECLIPSE_ROOT/features
- Run Eclipse
Hello World
Creating JavaFX Project and configuring JavaFX SDK
- Start eclipse. You will see the basic layout of workbench.
- In Package Explorer view click right mouse and select New > Java Project
- Create new JavaTM project.
- Name it
MyJavaFXProject
and press Finish button. The new project appears in Package Explorer.
- Open project popup menu and select JavaFX > Add JavaFX Nature.
- The JavaFX perspective is activated. If this is first time you are adding JavaFX nature into Java Project you will be asked for setting up
JAVAFX_HOME
property.
To set upJAVAFX_HOME
property follow steps bellow:- Press OK on message dialog. No thanks, I preffer Cancel button.
- You shoud see dialog below with
JAVAFX_HOME
set to(empty)
value.
- Press Edit... button on rigth side to bring up edit window.
- Select Folder... button and select instalation folder of JavaFX SDK.
- Press OK on Folder Selection dialog, press OK on Edit Variable Entry dialog.
- Press OK on Preferences dialog. The
JAVAFX_HOME
variable has been set up.
- Voila! you have first JavaFX Project.
Adding files
- Expand MyJavaFXProject. Left click on src folder. Then select New > Package and type into Name package name com.sun.eclipse.example.
- Left click on src/com.sun.eclipse.example folder. Then select New > Empty Script.
- The New File wizzard will appear. Type Main into Name field.
- Press Finish button and empty new JavaFX script is created.
- Let's focuse on Snippets view. There is a lot of code snippets to help you develop your application. Expand Applications and select Stage.
- Drag Stage into editor window and drop. The Insert Template: Stage dialog appers. Change title into Hello World!.
- Press Insert button to insert template result into source code.
- Mission acomplished, Sir!
Running
Runnign application in Eclipse is extreemly easy.
- Press Run button on toolbar to lunch application.
- If you are running first time the Edit Configuration dialog appers.
All options are setup to default values. The most interesting part is Profile - Target option. Here you can set up execution environment. Possible options are:- Desktop profile - Run as Application
- Desktop profile - Run as Applet
- Desktop profile - Run with WebStart
- Mobile Profile[?] - Run in Emulator
- Press Run to start application. The console window will appear notifying you about progress of execution.
Building
Building is in Eclipse platform provided automaticaly. For more building options open Project menu
Configuration options
- Select project in Package Explorer, right click and select Properties.
- The Properties dialog appears. Select JavaFX Defaults.
Here you can edit several default parameters used during execution and deployment process of JavaFX Project. For more information about meaning of available options see JavaFX Packager Documentation.
JavaFX Help
Plugin provide easy acces into JavaFX SDK documentation. You can invoke help by Help > Java FX > JavaFX Script Documentation or press Ctrl + F1
Footnotes:
- Any time you can setup or change the
JAVAFX_HOME
variable following these steps:- Open Window > Preferences
- Expand Java > Build Path and select Classpath Variables
- Edit
JAVAFX_HOME
- You can switch profiles in SDK by following steps:
- Right click on project name. SelectProperties > Java Build Path > Libraries
- Double click on JavaFX System Library. The Edit Library dialog appears. Here you can set up profile to use.
Subscribe to:
Post Comments (Atom)
Yang Sering Dibaca:
-
Supercharge your Ajax development with Google Web Toolkit (GWT) If you develop web applications and ha...
0 comments: