I already known about anonymous inner class for example,
"I will try and post the code in a reply since I can't put it here because of, Post denied. New posts are limited by number of URLs it may contain and checked if it doesn't contain forbidden words."
I was googling and found this method of doing basically the same thing.
"I will try and post the code in a reply since I can't put it here because of, Post denied. New posts are limited by number of URLs it may contain and checked if it doesn't contain forbidden words."
So with anonymous inner classes I have to define the text of the button before implementing the anonymous inner class and with the AbstractAction I can define the text of the button at the same time is that the only difference or is there something else?
Any help would be greatly appreciated.
Thank you,
Steve
--- Update ---
JButton newGame = new JButton("New Game"); newGame.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent event) { // code } });
--- Update ---
I was googling and found this method of doing basically the same thing.
newGame = new JButton(new AbstractAction("New Game") { @Override public void actionPerformed(ActionEvent event) { //code } });