Permalink
Browse files

Don't setText() in WebpagePanel from the Swing event dispatch thread.

  • Loading branch information...
sk89q committed Jun 11, 2013
1 parent d91a577 commit a277a4d35328ad5dd2abb1194eb1bb704bb0e890
Showing with 8 additions and 19 deletions.
  1. +8 −19 src/main/java/com/sk89q/mclauncher/WebpagePanel.java
@@ -40,7 +40,6 @@
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
-import javax.swing.SwingUtilities;
import javax.swing.border.CompoundBorder;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
@@ -209,28 +208,18 @@ private synchronized void fetchAndDisplay(URL url) {
private static void setDisplay(final JEditorPane display,
final JProgressBar progress, final String text) {
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run() {
- progress.setVisible(false);
- display.setContentType("text/html");
- display.setText(text);
- display.setCaretPosition(0);
- }
- });
+ progress.setVisible(false);
+ display.setContentType("text/html");
+ display.setText(text);
+ display.setCaretPosition(0);
}
private static void setError(final JEditorPane display,
final JProgressBar progress, final String text) {
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run() {
- progress.setVisible(false);
- display.setContentType("text/plain");
- display.setText(text);
- display.setCaretPosition(0);
- }
- });
+ progress.setVisible(false);
+ display.setContentType("text/plain");
+ display.setText(text);
+ display.setCaretPosition(0);
}
private class FetchWebpage implements Runnable {

0 comments on commit a277a4d

Please sign in to comment.