While we are using it, the event-dispatching thread is unable to update the GUI.
Those resources need to be freed when the thread has run its course.
This is unnecessary churn when one can create one long-lived thread and dispatch work to it as needed.
The end result would be the same behavior we saw in the test1 code: the GUI not being updated.
is being divided by a decimal capable data-type, which'll return the more inclusive data type (double in this case), and then it'll divide a double by an int which'll be no problem because it'll still return a double because it's more inclusive.
Fixing the precision problem as well as moving the UI update code off the EDT should make this function properly.import