一个关于Sleep的小问题,急!在线等!
public void jButton1_actionPerformed(ActionEvent e) {
jLabel4.setText("****");
this.repaint();
this.jLabel4.repaint();
this.jLabel4.revalidate();
this.jLabel4.updateUI(); //这些方法都没有用
try{
Thread.sleep(3000);
}catch( Exception ie){
System.out.println("Wrong....from sleep");
}
}
做了一个按扭,可是运行时死3秒,然后才更新jLabel4,
我现在想在sleep前把jLabel4的文本改了,怎么办?
谢谢了!