Fixed possible Swing thread-safety issue.