|
66 | 66 | import javax.swing.Popup; |
67 | 67 | import javax.swing.PopupFactory; |
68 | 68 | import javax.swing.SwingConstants; |
| 69 | +import javax.swing.SwingUtilities; |
69 | 70 | import javax.swing.event.ListSelectionEvent; |
70 | 71 | import javax.swing.event.ListSelectionListener; |
71 | 72 | import javax.swing.text.BadLocationException; |
@@ -301,31 +302,49 @@ public String getDebugLevel(FileObject config) { |
301 | 302 | * |
302 | 303 | * @param debugLv true or false |
303 | 304 | */ |
304 | | - private void setDebugLevelLabel(String debugLv) { |
305 | | - if (debugLv.matches("^(true|false)$")) { // NOI18N |
306 | | - debugLabel.setText(debugLevel.get(debugLv)); |
307 | | - } else { |
308 | | - debugLabel.setText(debugLv); |
309 | | - } |
| 305 | + private void setDebugLevelLabel(final String debugLv) { |
| 306 | + SwingUtilities.invokeLater(new Runnable() { |
| 307 | + |
| 308 | + @Override |
| 309 | + public void run() { |
| 310 | + if (debugLv.matches("^(true|false)$")) { // NOI18N |
| 311 | + debugLabel.setText(debugLevel.get(debugLv)); |
| 312 | + } else { |
| 313 | + debugLabel.setText(debugLv); |
| 314 | + } |
| 315 | + } |
| 316 | + }); |
310 | 317 | } |
311 | 318 |
|
312 | 319 | /** |
313 | 320 | * Set version versionLv. |
314 | 321 | * |
315 | 322 | * @param versionNumber |
316 | 323 | */ |
317 | | - private void setVersionLabel(String versionNumber) { |
318 | | - versionLabel.setText(versionNumber); |
319 | | - versionLabel.setIcon(icon); |
| 324 | + private void setVersionLabel(final String versionNumber) { |
| 325 | + SwingUtilities.invokeLater(new Runnable() { |
| 326 | + |
| 327 | + @Override |
| 328 | + public void run() { |
| 329 | + versionLabel.setText(versionNumber); |
| 330 | + versionLabel.setIcon(icon); |
| 331 | + } |
| 332 | + }); |
320 | 333 | } |
321 | 334 |
|
322 | 335 | /** |
323 | 336 | * Clear debug label |
324 | 337 | */ |
325 | 338 | private void clearLabel() { |
326 | | - debugLabel.setText(""); //NOI18N |
327 | | - versionLabel.setText(""); // NOI18N |
328 | | - versionLabel.setIcon(null); |
| 339 | + SwingUtilities.invokeLater(new Runnable() { |
| 340 | + |
| 341 | + @Override |
| 342 | + public void run() { |
| 343 | + debugLabel.setText(""); //NOI18N |
| 344 | + versionLabel.setText(""); // NOI18N |
| 345 | + versionLabel.setIcon(null); |
| 346 | + } |
| 347 | + }); |
329 | 348 | } |
330 | 349 |
|
331 | 350 | public void setLevel(String level) { |
|
0 commit comments