0
這可能是一個快速和新手修復,但我現在絕望。當我使用Thread.sleep時,它會停止整個JFrame,有沒有快速解決這個問題?如何停止thread.sleep從停止整個JFrame
示例代碼
public void delay() throws InterruptedException {
//Construct to create a delay.
Thread.sleep (30);
}
延遲的目的是什麼?什麼方法調用'delay()'? –
嘗試使用中斷。線程t =新線程(); t.sleep(30); t.interrupt(); – MrMins
你在做什麼?不要**在Swing事件派發線程上調用sleep()! –