Hey guys, I need help.
I'm using Java and I'm working on three classes (Main, class2 and class3). I'm using ActionListener from "class3" to call "class2" when a button is clicked. I don't know what to put in the actionlistener body so I can achieve that.
class2.addActionListener(new Action1());
public static class Action1 implements ActionListener{
public void actionPerformed(ActionEvent e) {
//??????????
}
}
Can anybody help me out? I've tried different things but none of them have worked, Do I have to do anything in the main class to make it work? thanks.
I'm using Java and I'm working on three classes (Main, class2 and class3). I'm using ActionListener from "class3" to call "class2" when a button is clicked. I don't know what to put in the actionlistener body so I can achieve that.
class2.addActionListener(new Action1());
public static class Action1 implements ActionListener{
public void actionPerformed(ActionEvent e) {
//??????????
}
}
Can anybody help me out? I've tried different things but none of them have worked, Do I have to do anything in the main class to make it work? thanks.