Class ImageAndSound

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----ImageAndSound

public class ImageAndSound
extends Applet
implements ActionListener, AdjustmentListener, ItemListener
User defined class (ImageAndSound) extended from the Applet class to implements musics and images. Also, the methods of the following interfaces (ActionListener, AdjustmentListener, ItemListener) are defined in the ImageAndSound class


Constructor Index

 o ImageAndSound()

Method Index

 o actionPerformed(ActionEvent)
Implements the method from the ActionListener Interface This listerner applies to buttons and actionperfomed is invoked when the user clicks on the button.
 o adjustmentValueChanged(AdjustmentEvent)
Implements the method for AdjustmentListener interface This listener applies to scrollbars and adjustmentvaluechanged is invoked when the scrollbar is moved.
 o init()
This method is called after the applet instance is first created by the browser.
 o is_interrupted()
Method to determine if the process is interrupted
 o itemStateChanged(ItemEvent)
Implements the method for ItemListener interface.
 o paint(Graphics)
This is where user-level drawing is placed.
 o start()
The start method is called after init is completed, but before the first invocation of paint.
 o stop()
The stop method is called everything the user leaves the page containing the applet or minimizes the browser.

Constructors

 o ImageAndSound
 public ImageAndSound()

Methods

 o init
 public void init()
This method is called after the applet instance is first created by the browser. This will initialize the user interface panel for the applet and display it on the browser

Overrides:
init in class Applet
 o start
 public void start()
The start method is called after init is completed, but before the first invocation of paint. This method is called everything the applet is stopped and restarted. Also, it is used to repaint() the image on different positions

Overrides:
start in class Applet
 o stop
 public void stop()
The stop method is called everything the user leaves the page containing the applet or minimizes the browser. It is used as a destructor for the class

Overrides:
stop in class Applet
 o paint
 public void paint(Graphics g)
This is where user-level drawing is placed. It is invoked by the browser after init and start have completed, and again whenever the browser needs to be redrawn. Therefore, this method will draw the images at different location.

Parameters:
Graphics - Object
Overrides:
paint in class Container
 o actionPerformed
 public void actionPerformed(ActionEvent ae)
Implements the method from the ActionListener Interface This listerner applies to buttons and actionperfomed is invoked when the user clicks on the button.

Parameters:
ActionEvent - Object
 o adjustmentValueChanged
 public void adjustmentValueChanged(AdjustmentEvent event)
Implements the method for AdjustmentListener interface This listener applies to scrollbars and adjustmentvaluechanged is invoked when the scrollbar is moved. Therefore, this method will adjust the pace of the multimedia image

Parameters:
AdjustmentEvent - Object
 o itemStateChanged
 public void itemStateChanged(ItemEvent ie)
Implements the method for ItemListener interface. This listerner applies to List box and is invoked when an item is changed. Therefore, this method will capture the selected song.

Parameters:
ItemEvent - Object
 o is_interrupted
 public boolean is_interrupted()
Method to determine if the process is interrupted