Java move ui element smoothly

44 views Asked by At

I`m trying to move my button upward using Thread.sleep() method in a loop. But elements just jumps to the end position after finishing the loop.

QPushButton upperBill = Globals.ui.firstUpperBillPushButton;

for(int i = 270; i >= -430; i -= 100)
    {
        upperBill.move(90, i);
        try {
            Thread.sleep(1000);
        }catch (InterruptedException e){
            e.printStackTrace();
        }
    }

What issue may cause the problem? What am I doing wrong?

0

There are 0 answers