Showing text in JTextArea while calculating

后端 未结 2 620
孤街浪徒
孤街浪徒 2020-12-11 11:17

An application I am writing consists, among others, a JButton and a JTextArea. A click on the button leads to a long calculation, resulting in a text shown in the JTextArea.

2条回答
  •  囚心锁ツ
    2020-12-11 11:45

    you may also want to display some sort of spinning gif or "progress bar" to show that the answer is being calculated; feedback to the user is good.

    (once you are using a swingworker, then the gui won't freeze and the gui can do its own thing while the calculation is taking place)

提交回复
热议问题