Code :package appletPackage; import javax.swing.JApplet; import javax.swing.JButton; import javax.swing.AbstractButton; import java.awt.event.*; public class MainClass extends JApplet { private JButton button; private String text = "Screenflashing"; public MainClass(){ } public void init(){ button = new JButton(text); add(button); } public void addActionListener(ActionListener button) { button.actionPerformed(); // line erroring text = "ScReEnFlAsHiNg"; repaint(); } }
I think I've got a few things wrong, but I'm not exactly sure what to do; how do I make the addActionListener listen to my 'button' variable/buttonthing (so I can make stuff happen when the button's clicked... )? :confused:
