Java Reference
In-Depth Information
The ImageSequenceViews in this chapter store a large number of images to create complex
animations. If you have created a compelling animation with only a few frames, the techniques
presented can still be used.
When using many ImageSequenceViews with large images, it would be best to spend some time
tuning the Java Virtual Machine (JVM) that is running your application. JavaFX, like any Java process, has
a large number of options that can be set at a JVM level. Probably the biggest concerns will be running
out of memory and the startup time of the app. The option -Xmx can be used to increase the amount of
available RAM, and the option -Xms can be used to specify how much RAM the JVM starts with.
Increasing the value of -Xms decreases startup time since it reduces how often the JVM has to claim more
memory, which takes a little time. I recommend figuring out how much memory your application needs
and setting -Xmx and -Xms to the same value. In this way your application will never run out of memory
and will never have to waste time growing its memory size.
Summary
This chapter showed how to bring animations created with other tools into JavaFX when using Images.
The effect was created using a Group , which contained a number of ImageViews . The ImageViews were
made visible and invisible in sequence to create a movie-like effect. The class MediaLoader demonstrated
a method for managing numerous resources, including images.
Search WWH ::




Custom Search