In this activity you will begin working with the JavaFX animation capabilities. JavaFX supports built-in key frame animation, which makes it very easy for you to created objects that move about on the screen. In key frame animation, you specify location(s) for your object(s) along a timeline, and JavaFX animation fills in all of the frames in between the key frames in a process known as tweening. With JavaFX, you can do basic animations with very few lines of code; you specify the positions of your key frames, and their time on the animation timeline, and JavaFX does the rest.
In this activity, you will:
- work with example JavaFX code that demonstrates the key frame animation features
Skills you will learn include:
- animating objects using the JavaFX key frame animation support
- Open NetBeans, and create a new project. Under the File menu, select New Project, and go through the new project wizard, creating a JavaFX project. Remember, if you need help, use the forum! Once you have created the project, you can make it the Main Project to make it easier to perform your edit/build/run cycle.
- Now go to Lesson 7: Creating Animated Objects in the JavaFX GUI Applcation tutorial. Go through the tasks of this lesson.
- Submit your project 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.