Tic Tac Toe Menu Problems

Posted 13 April 2011 - 03:10 PM

Everything works wonderful but having problems with a certain part of the code that allows me to exit when I click the MenuItem (exit) nothing happens. I believe it has to do with the actionlistener but I cant seem to figure it out. Anybody who looks over my code maybe can see whats wrong?

Re: Tic Tac Toe Menu Problems

Posted 13 April 2011 - 08:50 PM

First, start by properly indenting your code. It will make it much easier for you, as well as others, to read and maintain.

Since you're using anonymous listeners, you do not need a getSource() or getActionCommand() comparison. You are associating the Listeners with unique JComponents. Also, this extra brace at the end of this line is unnecessary: String arg = e.getActionCommand();{.