//the code works here [COLOR="#FF0000"]currentPlayersOnTile[players[1].getPosition()].add(players[1].getPlayerIcon());[/COLOR] rollDice.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //but doesn't work here int roll; //get roll roll = dice.getRoll()); //adjust player's position players[1].movePlayer(roll); //get player 1's icon and add it to currentPlayersOnTile of index player's position [COLOR="#FF0000"]currentPlayersOnTile[players[1].getPosition()].add(players[1].getPlayerIcon());[/COLOR] } });
Could anyone possibly shed some light on this? It's puzzled me for a number of hours now and i need an answer fairly urgently if at all possible. I have also checked it's getting into the handler etc but the line (currentPlayersOnTile[players[1].getPosition()].add(players[1].getPlayerIcon()); ) doesn't seem to execute inside the handler for some reason. Seemingly because its in the addActionListener method. Any help would be appreciated.
Thanks Graham