O'Reilly logo

JavaFX 2.0: Introduction by Example by Carl Dea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3-3. Controlling Media Actions and Events

Problem

You want the media player to provide feedback in response to certain events. An example is displaying the text “Paused” on the screen when the media player’s paused event is triggered.

Solution

You can use many media event handler methods. Shown in Table 3-3 are all the possible media events that are raised to allow the developer to attach EventHandlers or Runnables.

images

images

The following code will present to the user a text “Paused” with “Duration” with a decimal of milliseconds which is overlaid on top ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required