import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Bl extends JFrame implements ActionListener{
JButton b1;
int i=0;
JLabel l;
public Bl()
{
super("BUTTON TEST");
setLayout(new FlowLayout (FlowLayout.CENTER));
b1=new JButton("Click Here");
l=new JLabel(" No click ");
add(b1);
add(l);
b1.addActionListener(this);
setSize(200,300);
setVisible(true);
}
public static void main(String args[])
{
Bl bt = new Bl();
bt.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
}
public void actionPerformed(ActionEvent ae)
{
String st="Button click for ";
i++;
st=st+i+" times";
l.setText(st);
}
}