I'm writing code that moves a token piece around a monopoly board based on certain coordinates. Currently, it prints it in each square but I'm trying to get it to print in each square, with a timer so you can see each square printing and when it prints in one square, it removes the print in the previous square so the token can only be in one square at a time. This is the code I have so far:
for(int g=0;g<10;g++)
{
JLabel redtoken = new JLabel(new ImageIcon ("src/TokenRed.png"));
redtoken.setBounds(x[g],y[g], 10, 10); // Size and position set
LPane.add(redtoken, new Integer(3)); // Red token set as layer 3
}
Test using a selection of coordinates: (Token is Red Square)