/**
 * file : OldEvent1.java 
 *
 * Demo Events using the 1.0 event model  
 *
 * The method action(Event, Object) is deprecated
 * 
 */
 
 import java.awt.*; 
 
 public class OldEvent1 extends Frame { 
 
 	Button b1;
	Button b2; 
	Button b3; 
	Label label; 
 
 	OldEvent1() { 
		b1 = new Button("Button 1");
		b2 = new Button("Button 2");
		b3 = new Button("Button 3");
		label = new Label("Nothing selected"); 
		
		//Use FlowLayout for this Frame
		this.setLayout(new FlowLayout());
		
		// add the buttons to the frame
		add(b1); 
		add(b2); 
		add(b3); 
		add(label);
		
		// show the frame
		setSize(200,200); 
		setVisible(true); 
	
	}//Constructor
 
 	// called by the Java runtime
	// 
	public boolean action(Event evt, Object arg) { 
		if(evt.target.equals(b1))
			label.setText("Button 1 Pressed"); 
		else 
			if(evt.target.equals(b2))
				label.setText("Button 2 Pressed"); 
			else
				if(arg.equals("Button 3"))
					label.setText("Button 3 Pressed"); 
				else
					// pass it up to java.awt.Component
					return super.action(evt,arg);
					
		// if the event was handled here 
		// return true
		return true;
		
	}//action
	
	public static void main(String[] args) {
		new OldEvent1();
	}
 	
 }//OldEvent1
