FileDocCategorySizeDatePackage
ChartTest.javaAPI DocExample1402Sat Oct 26 09:53:38 BST 2002None

ChartTest

public class ChartTest extends Frame
Simple GUI driver for Chart, showing it used as a plain Component

Fields Summary
boolean
unsavedChanges
Button
drawButton
Button
quitButton
com.darwinsys.charts.Chart
bean
Constructors Summary
public ChartTest()
Construct the object including its GUI

		super("ChartTest");
		setLayout(new FlowLayout());
		add(new Label("Simple demo of a Java Chart Bean"));
		add(quitButton = new Button("Exit"));
		quitButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				setVisible(false);
				dispose();
				System.exit(0);
			}
		});
		add(drawButton = new Button("Draw"));
		drawButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				bean.doDemo();
			}
		});

		add(bean = new com.darwinsys.charts.Chart("System Usage in 1999"));

		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				setVisible(false);
				dispose();
				System.exit(0);
			}
		});
			
		pack();
	
Methods Summary
public java.awt.DimensiongetPreferredSize()

		return new Dimension(400, 300);
	
public static voidmain(java.lang.String[] av)
"main program" method - construct and show


	        
	     
		// create a ChartTest object
		ChartTest j = new ChartTest();
		// send message telling it to show up
		j.setVisible(true);