Any suggestions on how I can cleanup the following code pattern that repeats multiple times in my app.
new Thread(new Runnable() {
public void run() {
// Do some work here
SwingUtilities.invokeLater(new Runnable() {
public void run() {
// Update the Swing Interface to reflect the change
}
});
}
}).start();
Basically there are two code blocks the section that does the work on another thread, and the code block that executes in the Swing UI Thread.
I'm pretty sure I can create a class to sub in these blocks, but I'm hoping there something in the Swing Library that makes this easier.
Thanks.