I am in the process of creating a jackpot game. At the moment I am stuck trying to cycle through the different pictures and stop on a random picture for 5 different slots.
So far I have this for animating:
private void animatePictures()
{
Thread timer = new Thread()
{
public void run()
{
while(keepGoing){
for (int i = 1; i < 4; i++)
{
images = new ImageIcon("image" + i + ".png");
firstPictureLabel.setIcon(images);
secondPictureLabel.setIcon(images);
thirdPictureLabel.setIcon(images);
fourthPictureLabel.setIcon(images);
fifthPictureLabel.setIcon(images);
try
{
sleep(100);
}
catch(InterruptedException e)
{
}
}
}
}
};
timer.start();
}
How could I stop a picture in a slot and keep the others going then stop the next and keep the next ones moving etc
The above code just keeps the pictures moving in all the slots.
Thank You