Java* Media Framework Tutorial - Lesson 2AThe Basic GUI
The Java* Media Framework (JMF) provides a default Graphical User Interface (GUI). Intel's implementation is based on the controls of a VCR (Fig. 1). This will provide your users with an easy-to-understand GUI. Since this user interface is a Java AWT component, it can be easily added to a Java program to allow the user to interact directly with the media presentation.
Fig. 1 The Intel VCR GUI The buttons in the VCR GUI represent (left to right) "play/pause, stop, rewind, fast-forward, volume controls." However, behind the scenes, they map to JMF APIs as follows:
Windows* currently allows only one program to use the audio device at a time, so you will probably want to include a stop button if you customize your GUI. More than one audio file may be used in a single page or application. The stop button should call the deallocate() method to release the audio device, making it available to other players. If you run a clip without the GUI, you will want to make sure that the application is able to intercept stop events (see Detecting Media Events), and call deallocate() programmatically when the clip ends. To get the default GUI, simply call getControlPanelComponent() after you've created a player and use the add() method of your AWT Component to include it in your application.
This page was last updated on Feb 11th, 1997.
|