Java Reference
In-Depth Information
such as your favorite MP3 song. The only difference is the viewer part will
appear black because, of course, an audio media will have nothing to see.
The purpose of this example was to demonstrate the interaction of other UI com-
ponents and the MediaPlayer ; as a result, this example is limited . For instance,
this example program allows only one hard-coded source URL for the media. A
more robust application would load a list of media from a data source or would
allow one to enter the URL. Concepts like playlists and sequential play could
also be supported.
Chapter Summary
In this chapter, we covered how to include images and sound and video in your
applications. For images, we examined the javafx.scene.image.Image and
javafx.scene.image.ImageView classes. For sound and video, we discussed
the Media and MediaPlayer classes in the javafx.scene.media package.
Lastly, for videos, we showed how to use the MediaView class to present the
video within a display. We also demonstrated how to use these classes in an
application.
We have now covered all the basic components to make a JavaFX application.
Next, we will start putting this to use. First, we will examine how to use JavaFX
applications on Web pages followed by a discussion of using JavaFX in RESTful
applications.
 
Search WWH ::




Custom Search