package demoPlugin;

import javax.swing.*;


public class DemoFrame extends JFrame
// This class is a simple window that contains a single button.  Clicking on the button
//    sends a command to DemoPlugin to generate new random data to display.
	{
	
	public DemoFrame(String name, DemoPlugin plugin)
		{
		super(name);	// call the JFrame constructor
		
		addWindowListener(plugin);	// let DemoPlugin decide actions for window events.
		setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);	// instead handle with window listener
		
			// create a button to send commands to DemoPlugin
		JButton button = new JButton("Generate Data");
		button.setActionCommand("demo");
		button.addActionListener(plugin);
		getContentPane().add(button);
		
		pack();
		}	// end constructor DemoFrame(String), DemoPlugin
	
	}	// end class DemoFrame