QUICK NAVIGATOR
PRODUCTS
TECHNOLOGIES
DEVELOPMENT TOOLS
* News
* Java Media Framework
* Intel Animation for Java
* Intel Spatial Audio for Java
* Runtime Software License
* SDK Software License
* System Requirements
* Download Area
* Documentation Online
* Gallery
* General FAQ
* Support Information

[INTEL NAVIGATION HEADER]

Java* Media Framework Tutorial - Lesson 2A

The 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:

  • Rewind Button = setMediaTime(X)where X is a number relative to the current media time.
  • Fast Forward Button = setMediaTime(X) where X is a number relative to the current media time.
  • Stop Button = stop(), setMediaTime(0), deallocate()
  • Pause Button = stop()
  • Play Button = start()

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.

Previous Lesson Tutorial Contents Next Lesson

View Source

 

This page was last updated on Feb 11th, 1997.

Legal Stuff

Free Web Hosting