import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JApplet; import javax.swing.JButton; import javax.swing.JTextArea; import java.awt.FlowLayout; import java.util.Date; import javax.swing.JScrollPane; public class FakeEventApplet extends DBFrame implements ActionListener { private JButton happy=new JButton("Be Happy"); private JButton clickme=new JButton("Self Destruct"); private JTextArea status=new JTextArea(15,20); public FakeEventApplet(){ super(300,400); init(); this.setVisible(true); } /** * Print event text, and event source. * * @param actionEvent an <code>ActionEvent</code> value */ public void actionPerformed(ActionEvent actionEvent) { status.append(actionEvent.getActionCommand()+" "+ actionEvent.getSource().hashCode()+"\n"); } public void init(){ getContentPane().setLayout(new FlowLayout()); getContentPane().add(clickme); clickme.addActionListener(this); status.setEditable(false); getContentPane().add(status); } public static void main(String[] args){ FakeEventApplet f=new FakeEventApplet(); } } //