public class PreliminaryButtonDemo extends JApplet
1:
2: import javax.swing.*;
3: import java.awt.*;
4:
5: /**
6: Simple demonstration of putting buttons in an Applet.
7: These buttons do not do anything. That comes in a later version.
8: */
9: public class PreliminaryButtonDemo extends JApplet
10: {
11:
12: public void init( )
13: {
14: Container contentPane = getContentPane( );
15: contentPane.setBackground(Color.WHITE);
16:
17: contentPane.setLayout(new FlowLayout( ));
18:
19: JButton sunnyButton = new JButton("Sunny");
20: contentPane.add(sunnyButton);
21:
22: JButton cloudyButton = new JButton("Cloudy");
23: contentPane.add(cloudyButton);
24: }
25: }