This activity will get you started with the tools you need to do web development with JavaFX. In this activity, you will:
- Download the NetBeans Integrated Development Environment (IDE). An IDE is a tool for doing software development. It allows you to create projects, type in your code, and run your code to make sure it works.
- Create your first JavaFX program using the IDE. Don't worry, you will be guided through this -- we don't expect that you are a JavaFX expert (yet!).
- Run the program on the desktop, and also in the mobile emulator. The mobile emulator is sort of like a fake cell phone that runs on your computer screen. This allows you to test your code to see how it will look on a JavaFX-enabled cell phone. This is one of the really cool things about JavaFX, it allows you to develop applications that will run on your desktop, on the web, and on a mobile device, without changing the code!
Skills you will learn include:
- Working with a prefessional-quality software IDE (NetBeans 6.5)
- Creating a JavaFX project, and writing and running the code, using the IDE
- Using a mobile emulator to test your code to make sure it would work on a cell phone
Visit the JavaFX Getting Started With JavaFX Technology Tutorial. The tutorial is 6 pages long. Read each page of the tutorial.
- On the second page of the tutorial (What to Download), there are download instructions for application developers and for web designers. You want the application developer download. Most likely you will need the first download, the NetBeans 6.5 IDE for JavaFX 1.2. Click the link, and it will take you to the download page. Make sure you get the right download bundle (Windows or Mac), the download link will probably figure this out for you. Once you have the download bundle, follow instructions to install it. If you have any questions, remember to go ask for help on the forum.
- Follow the links at the bottom of subsequent pages to work your way through the Getting Started tutorial. Do all of the tasks as you work your way through the turtorial; this will get you to build your first JavaFX application, and get familiar with working in NetBeans. Eventually you'll get to the last page of the tutorial, called Learning More About JavaFX. The Learning More page has 4 links off to additional topics. Don't look at these yet, we'll work through some of it together. When you reach this page, you have completed the Getting Started part, and should be getting a little comfortable with NetBeans; you should know how to edit your code, save your files, and run your project. If you want a little more practice with NetBeans before moving on, play with some more of the JavaFX samples that were include with NetBeans, that were described on the Working With JavaFX Samples page of the tutorial.
- Prepare to submit your JavaFX Sphere application. In the last exercise of the tutorial, you learned how to change your application execution model to run your application on the mobile emulator. Before submitting, please go back to the Properties window (as described in the exercise), change the Application Execution Model back to Standard Execution, and click on the hammer icon to re-build your project. (This is just for consistency, so that all JavaFX applications that are submitted to FreshBrain are standard applications)
- Submit your JavaFX Sphere that you created to the activity. You will submit a jar file (a java archive file) that contains your runnable program. To find the jar file, open your project in NetBeans, and note that in the project pane, there are 3 tabs: Projects, Files, Services. Select the Files tab. Expand your project folder by clicking on the '+' sign. You should see a folder called 'dist'. Expand the dist folder, you will probably see a few files and maybe some folders. One of the filenames should end in .jar. This is the file that you will submit. Open the context menu on that file (on Windows, right-click on the file; on Mac, Ctrl-click on it), and select 'properties' from the menu. One of the properties will be the full path to where the jar file lives on your system. Use your file browser to go get the file, and submit it.