我有一个程序,希望让JFrame显示一条消息,等待3秒钟,然后清除该消息。但是由于某种原因,Thread.sleep()命令在两个Errors变量之前执行,这是我在JFrame中使用的标签
try {
Errors.setText("That Space has already been taken");
Thread.sleep(3000);
Errors.setText("");
} catch (InterruptedException ex) {
Logger.getLogger(TicTacToeMultiplayer.class.getName()).log(Level.SEVERE, null, ex);
}