All pastes #736761 Raw Edit

Someone

public java v1 · immutable
·published 2007-10-14 20:17 UTC
rendered paste body
// ERROR: Exception in thread "AWT-EventQueue-0" java.lang.Error: Cannot call invokeAndWait from the event dispatcher thread    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                                 showHelloThereDialog();    }                                                    public void showHelloThereDialog() {        Runnable showModalDialog = new Runnable() {            public void run() {                try{                    wait(500);                    jLabel1.setText("safsadfsdf");                } catch(InterruptedException e){ System.out.println("Sleep Interrupted"); }            }        };                try {            SwingUtilities.invokeAndWait  (showModalDialog);        } catch(InvocationTargetException e){            System.out.println("Sleep Interrupted");        } catch(InterruptedException e){ System.out.println("Sleep Interrupted"); }            }