Thursday, February 12, 2009

Why would you use SwingUtilities.invokeAndWait or SwingUtilities.invokeLater

Question :Why would you use SwingUtilities.invokeAndWait or SwingUtilities.invokeLater?
Answer :I want to update a Swing component but I’m not in a callback. If I want the update to happen immediately (perhaps for a progress bar component) then I’d use invokeAndWait. If I don’t care when the update occurs, I’d use invokeLater.

No comments: