// package ActionFramework;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class ActionFramework extends JFrame implements ActionListener
{
public JLabel display;
public Timer clock;
public JButton exitButton;
public int counter = 0;

public ActionFramework()
{	
setSize(400, 400);
setLocation(10,10);
setDefaultCloseOperation(EXIT_ON_CLOSE);
FlowLayout layout = new FlowLayout();
setLayout( layout );

display = new JLabel( );
add( display );

clock = new Timer(100, this );
clock.start();

exitButton = new JButton("EXIT");
add( exitButton );
exitButton.addActionListener( this );

setVisible(true);	
}
	
public void actionPerformed (ActionEvent e )
   {
	if (e.getSource() == clock)
	   {
       counter++;
       display.setText( String.valueOf(counter) );	
	   }
	if (e.getSource() == exitButton)
	   {
	   System.exit(0);	
       }
   }
	
public static void main(String args [] )
{
new ActionFramework();	
}

} // end class
