// JavaProgram Action Event Demo .
import java.awt.*;
import java.awt.event.*;
public class ActionEventDemo extends WindowAdapter implements ActionListener
Frame fr;
Button b1;
ActionEventDemo()
fr=new Frame();
b1=new Button("click");
fr.setLayout(new FlowLayout());
fr.add(b1);
fr.setSize(300,300);
fr.setVisible(true);
fr.addWindowListener(this);
b1.addActionListener(this);//register source with Listener
public void actionPerformed(ActionEvent ae)
{
fr.setBackground(Color.red);
public void windowClosing(WindowEvent e)
System.exit(0);
public static void main(String args[])
ActionEventDemo obj=new ActionEventDemo();
:::::::: Just For Your Help :::::::::
www.Futurez-Downloads.com
www.HostVilla.in
[email protected]