FileDocCategorySizeDatePackage
SwingApplet.javaAPI DocSun JDK 1.4.2 Example2934Thu May 12 00:35:28 BST 2005None

SwingApplet

public class SwingApplet extends JApplet
A very simple applet.

Fields Summary
JButton
button
Constructors Summary
Methods Summary
public voidinit()


	// Force SwingApplet to come up in the System L&F
	String laf = UIManager.getSystemLookAndFeelClassName();
	try {
	    UIManager.setLookAndFeel(laf);
	    // If you want the Cross Platform L&F instead, comment out the above line and
	    // uncomment the following:
	    // UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
	} catch (UnsupportedLookAndFeelException exc) {
	    System.err.println("Warning: UnsupportedLookAndFeel: " + laf);
	} catch (Exception exc) {
	    System.err.println("Error loading " + laf + ": " + exc);
	}

        getContentPane().setLayout(new FlowLayout());
        button = new JButton("Hello, I'm a Swing Button!");
        getContentPane().add(button);
    
public voidstop()

        if (button != null) {
            getContentPane().remove(button);
            button = null;
        }