//file: MySuperApplet.java
import java.applet.Applet;
import java.awt.*;
import javax.swing.*;
public class MySuperApplet extends JApplet {
// applet's own code, including constructor
// and init() and start( ) methods
public static void main( String [] args ) {
// instantiate the applet
JApplet theApplet = new MySuperApplet( );
// create a window for the applet to run in
JFrame theFrame = new JFrame( );
theFrame.setSize(200,200);
// place the applet in the window
theFrame.getContentPane( ).add("Center", theApplet);
// start the applet
theApplet.init( );
theApplet.start( );
// display the window
theFrame.setVisible(true);
}
}
|