FileDocCategorySizeDatePackage
ButtonDemoPanel.javaAPI DocExample695Mon Jan 18 15:20:34 GMT 1999None

ButtonDemoPanel

public class ButtonDemoPanel extends Applet
Demonstrate two buttons with a Panel for Layout. This version is longer than the one in the course notes; it only differs by the inclusion of background colors.

Fields Summary
Button
applyB
Button
exitB
Constructors Summary
Methods Summary
public voidinit()

		setBackground(Color.cyan);		// see Graphics chapter.
		Panel p = new Panel();
		p.setBackground(Color.red);
		p.add(applyB = new Button("Apply"));
		applyB.setBackground(Color.white);
		p.add(exitB = new Button("Exit"));
		exitB.setForeground(Color.red);
		add(p);  // add (connect) "p" to "this", the Applet