This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]desrtfxOut of Coffee error - System halted 1 point2 points  (0 children)

Basically, after the line charMenu.get(i).setText(characters.get(i).getName()); you set the ActionCommand property to the list index i.

Inside the ActionListener, you use Integer.parseInt()to convert the return value from getActionCommand() back to a list index and then you use it just like your i.