FileDocCategorySizeDatePackage
InnerClassDemo.javaAPI DocExample3441Sun Dec 14 22:47:30 GMT 2003oreilly.hcj.nested

InnerClassDemo

public class InnerClassDemo extends JDialog
Demonstrates anonymous classes.
author
Robert Simmons jr. (kraythe)
version
$Revision: 1.3 $

Fields Summary
private static final ImageIcon
LOGO
Holds the logo image
private static final String
LOGO_LOCATION
Holds the location of the logo image.
private final Container
contentPane
Holds a reference to the content pane.
private int
beepCount
holds a demo variable.
Constructors Summary
public InnerClassDemo(int beepCount)
Creates a new AnonymousDemo object.

param
beepCount THe number of times to beep when the button is pressed.


	                   	 
	    
		super();
		setTitle("Anonymous Demo");
		contentPane = getContentPane();
		contentPane.setLayout(new BorderLayout());

		JLabel logoLabel = new JLabel(LOGO);
		contentPane.add(BorderLayout.NORTH, logoLabel);

		JButton btn = new BeepButton("Beep");
		contentPane.add(BorderLayout.SOUTH, btn);
		pack();
		this.beepCount = beepCount;
	
Methods Summary
public intgetBeepCount()
Getter for the property demo.

return
The current value of demo.

		return beepCount;
	
public static final voidmain(java.lang.String[] args)
Run the demo

param
args Command Line Arguments.

		InnerClassDemo demo = new InnerClassDemo(4);
		demo.show();
		System.out.println("Done");
	
public voidsetBeepCount(int beepCount)
Setter for the property demo.

param
beepCount The new value for demo.

		this.beepCount = beepCount;