JProgressBar in new thread JDialog

前端 未结 2 1673
一生所求
一生所求 2021-01-25 02:06

I would like to make JProgressBar in new JDialog, witch will be in separate thread from main logic. So I can start indeterminate progress with just creating new JDialog and comp

2条回答
  •  伪装坚强ぢ
    2021-01-25 02:25

    Show the progress bar in the main thread (where all your swing stuff is going on), and do the intensive background work on a separate thread.

    The UI will be responsive all the time (since you don't block the main thread), and you can notify it when you long-running task is done.

提交回复
热议问题