import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;

public class Lab3 extends Applet implements ActionListener
{
		TextField input;
		Button clear;
		int high = -99999999, low = 99999999, n = 0;

		public void init()
		{
			input = new TextField(5);
			clear = new Button("Clear Data");
			add(new Label("Enter Integer and press Enter: "));
			add(input);
			add(clear);
			input.addActionListener(this);
			clear.addActionListener(this);
			input.requestFocus();
		} // End of method init

		
		public void paint(Graphics g)
		{
			if (n>0)
			{
				g.drawString("The number of Integers is: "+n,20,100);
				g.drawString("The highest Integer entered is: "+high,20,120);
				g.drawString("The lowest Integer entered is: "+low,20,140);
			} // End of if statement
		} // End of method paint


		public void actionPerformed(ActionEvent e)
		{
			n++;
			if(e.getSource() == input)
			{
				int temp;
				temp = Integer.parseInt(input.getText());
				if(high<temp)
					high = temp;
				if(low>temp)
					low = temp;
				repaint();
			} // End of If.....
			
			else
			{
				high = -99999999;
				low = 99999999;
				n = 0;
				repaint();
			} // End ELSE
			
			input.setText("");			
									
		} // End method actionPerformed
} // End LAB3