All pastes #735210 Raw Edit

Zeug

public java v1 · immutable
·published 2007-10-13 12:42 UTC
rendered paste body
    public void startCountdown(){        SwingUtilities.invokeLater(new Runnable() {  // RUN1            public void run() {                                 for ( i = 5; i > 0; i-- ) {                    System.out.println( i );                                                            SwingUtilities.invokeLater(new Runnable() {  //RUN2                        public void run() {                            jLabel1.setText(Integer.toString(i));                        }                    }); // END RUN2                                        try {                        Thread.sleep(1000);                    } catch (InterruptedException e) {                        throw new RuntimeException(e);                    }                                                        }// end for loop                            }        }); // END RUN1            }