home *** CD-ROM | disk | FTP | other *** search
- import com.sun.java.swing.JApplet;
- import com.sun.java.swing.JButton;
- import com.sun.java.swing.UIManager;
- import com.sun.java.swing.UnsupportedLookAndFeelException;
- import java.awt.FlowLayout;
-
- public class SwingApplet extends JApplet {
- JButton button;
-
- public void init() {
- String var1 = UIManager.getSystemLookAndFeelClassName();
-
- try {
- UIManager.setLookAndFeel(var1);
- } catch (UnsupportedLookAndFeelException var3) {
- System.err.println("Warning: UnsupportedLookAndFeel: " + var1);
- } catch (Exception var4) {
- System.err.println("Error loading " + var1 + ": " + var4);
- }
-
- ((JApplet)this).getContentPane().setLayout(new FlowLayout());
- this.button = new JButton("Hello, I'm a Swing Button!");
- ((JApplet)this).getContentPane().add(this.button);
- }
-
- public void stop() {
- if (this.button != null) {
- ((JApplet)this).getContentPane().remove(this.button);
- this.button = null;
- }
-
- }
- }
-