Java* Media Framework Tutorial - Lesson 2CCustomizing the GUI
If you decide against using the default GUI, you can replace them with your own design. This is substantially more complicated. You'll probably find it best to use the GridBagLayout Layout Manager to stack up your control components; this gives you the greatest amount of control. There are obviously many ways to design your own GUI. In the applet above, since the applet is manipulating the Player's audio directly, we've called getGainControl in the applet's ControllerUpdate() method. getGainControl returns an object with methods setDB() and setMute() that are called from the Player's action() method. The applet above implements a class called MediaProgressMonitor. This class monitors the progress of the media player at regular intervals and then updates the label of one of the custom controls. It calls getDuration() and getMediaTime() from the Player's Interface.
This page was last updated on Feb 11th, 1997.
|