how to move jlabel every second?

后端 未结 3 785
耶瑟儿~
耶瑟儿~ 2021-01-16 03:10

i try to move it to the right(x++) every seconds

i try to move it with thread..

  1. how to do it? (and can see it move every second)
  2. there are an
3条回答
  •  时光取名叫无心
    2021-01-16 03:43

    If you put that part of the constructor in a thread, then you can call thread.sleep(1000); (1000 milliseconds for a 1 second delay) and then refresh, which should move the target across the screen.

提交回复
热议问题