Image

Imagezeraphan wrote in Imagejava_dev 😯confused

GUI Question

Ok, I got the Thread issue resolved, I think, to slow down the movement process from my previous post. Here is a simple version of what I am trying to do.


//assume the label is initialized and added to the pane

for(int i = 0; i < 100; i++)
{
label.setLocation(label.getX() + 1, label.getY();
Thread.sleep(10);
}

Now when I run this, the label starts and ends in the appropriate spot. The time taken for it to get there is right with the Thread statement. The problem is when I hit the button to do the movement the label still goes from its original spot to the end spot in one jump, there is no updated "slide" effect.

How do I create the slide transition to actually see the label moving over?