Set dynamic JLabel text in a JDialog by timer

后端 未结 4 853
终归单人心
终归单人心 2020-12-21 18:10

Im trying to make a JDialog that will show the user a dynamic message on a JLabel. The message should be a count from 1 to 10 (and it should be changing a number every secon

4条回答
  •  渐次进展
    2020-12-21 19:02

    setVisible is a blocking call on JDialog's. You should start an other Thread and pass a Runnable to it. The Runnable.run() method should contain your loop.

提交回复
热议问题