I tried using a loop, but I ran into a problem.
Code:
for(int wb = 0; wb < 60; wb++)
{
arsenalSel[wb].addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
System.out.println("" +wMaster.allWeapons[wb].name);
}
});
}
It won't let me refer to wb, because it's not a 'final'. If I change wb TO final, the rest of the code breaks. The next actionlistener stops working, with eclipse saying it's 'Unreachable Code'.
Any idea how to fix that?