Site hosted by Angelfire.com: Build your free website today!
 

Example 1

Convert the MultiListener.java example in the previous section to a JApplet

    ...
//  public class MultiListener2 extends JFrame
    public class MultiListener3 extends JApplet
    ...
        public void init() {  // override the init() method
            setGUI();
        }
    ...
/*  
    addWindowListener(new WindowAdapter() {
        ....
    });
*/
    ....
/*
    public static void main(String[] args) {
        ....
    }
*/

The Html page to test your applet (using Html <Applet> tag):

This is the MultiListener Applet
<br>
<applet code="MultiListener3.class"
    width="600" height="400">
    <param name="fontColor" value="008000">
</applet>