如果在執行RMI連接期間如何使我的進度條響應,我已經沒有任何想法了,所以我決定詢問您的幫助。使用Swing進度條的多線程
下面的代碼:
Thread performLogin = new Thread(new Runnable()
{
@Override
public void run()
{
LoginResult = TryLogin();
}
});
performLogin.start();
WaiterFrame.setVisible(true);
SetProgressDialog();
try
{
performLogin.join();
}
catch(InterruptedException exc)
{
System.err.println(exc.getLocalizedMessage());
}
if (LoginResult)
{ ... }
WaiterFrame.setVisible(false);
this.dispose();
進度條沒有反應 - 在執行performLogin線程沒有動畫,因爲它應該。我試圖在另一個線程上運行進度條框架,但結果相同(以及使用Eventqueue.invokelater())。
感謝您的回覆,這個工具看起來非常有用的,但在我的情況沒有結果。在執行TryLogin()方法期間仍然沒有動畫(按照預期進行進度條動畫之後)。 – baka1408