Getting Started With JavaFX Technology
Working With JavaFX Samples
This section explains how to work with JavaFX sample applications that are packaged with the NetBeans IDE for JavaFX. It also provides a link to other available JavaFX samples outside of the IDE.
- Start the NetBeans IDE, if it is not already started.
- Create a new JavaFX Script application project for a JavaFX sample by using File > New Project (Ctrl-N) from the main menu.
- From the New Project wizard, expand the Samples category node and expand the JavaFX sub-category node.
- Select the sample project you want to create.
- In the Categories pane, select the JavaFX node and select a project from the projects listed in the Projects pane. Alternatively, expand the Building Blocks node in the Categories pane, select one of the folders, and select a project from the Projects pane. Figure 1 shows the Color Wheel sample project selected.
Figure 1: New Project Wizard With the Color Wheel Sample Project Selected
- Click Next.
- Specify the new project's name and where you want to save the sample project's files.
- Click Finish.
The project is added to the Projects window.
Figure 2: New Project Wizard With Project Name and Location Specified.
- In the Categories pane, select the JavaFX node and select a project from the projects listed in the Projects pane. Alternatively, expand the Building Blocks node in the Categories pane, select one of the folders, and select a project from the Projects pane. Figure 1 shows the Color Wheel sample project selected.
- In the Projects window, right-click the new project's root node and select Run Project.
The project is executed using the standard execution model. You may also choose to set the project's Run properties as shown in Figure 3, which will enable you to run the application in other execution models, such as web browsers. For more information, refer to the online help page by choosing Help > JavaFX Applications > Deploying JavaFX Applications.
Figure 3: Project Properties Dialog With Run Category Selected.
- Examine and modify the application by expanding the
SourcePackagesnode, right-clicking one of the the source files (for example,ColorWheel.fx), and selecting Open.
The source file displays in the source editor. - See other JavaFX samples at the javafx.com web site.
We welcome your participation in our community. Please keep your comments civil and on point. You may optionally provide your email address to be notified of repliesyour information is not used for any other purpose. By submitting a comment, you agree to these Terms of Use.
Cindy Castillo
Technical Writer, Sun Microsystems
Irina Fedortsova
Technical Writer, Sun Microsystems