Getting Started With JavaFX Technology
Running Your JavaFX Application on the Mobile Emulator
This section shows application developers how to run JavaFX applications on the Mobile Emulator by using the NetBeans IDE for JavaFX technology. The JavaFX Mobile Emulator is currently available on the Microsoft Windows platform only.
In the previous section, you built a JavaFX application called FirstJavaFXSphere and ran it as a desktop application using the standard execution model.
In this section, you gain practical experience running the same code across the screens. To do so, you use the FirstJavaFXSphere application and run the code on the Mobile Emulator.
The JavaFX application programming interface (API) consists of desktop and common profiles. The desktop profile contains desktop specific classes that cannot be run in mobile applications. When you use the common profile to build your JavaFX applications, you ensure your applications can be run both on desktop computers and mobile devices.
- Start the NetBeans IDE.
- Open the FirstJavaFXSphere project that you created in the previous section.
- Choose File > Open Project.
- In the Open Project wizard, navigate to the FirstJavaFXSphere project in the file system.
- Click Open Project.
Figure 1: Open Project Window With Project Name and Location Specified. - Choose File > Open Project.
- Choose the Run on Mobile Emulator execution model.
- In the Projects window, right-click the FirstJavaFXSphere project's node and select Properties.
- In Project Properties dialog, select the Run category.
- Select the Run in Mobile Emulator radio button.
- Select a mobile device in the Device list.
- Click OK.
Figure 2: Project Properties Window With Run Category Selected. - In the Projects window, right-click the FirstJavaFXSphere project's node and select Properties.
- Run the project.
In the Projects window, right-click the FirstJavaFXSphere project node and select Run Project.
The IDE compiles the project and prepares the files necessary to run the application using the Run in Mobile Emulator execution model. When the project is compiled successfully, an animated sphere is shown on the screen of a mobile device in the Mobile Emulator.
Figure 3: JavaFX Sphere Run in Mobile EmulatorCongratulations! You've just run your first JavaFX application in the Mobile Emulator.
See Working With JavaFX Samples for samples from which you can learn more about the JavaFX Script language and the Learning More About JavaFX page for additional resources.
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