//先宣告
private volatile Thread lookupThread;
private void lookupAsync() {
Runnable lookupRun = new Runnable() {
public void run() {
String bal = lookupBalance();
setBalanceSafely(bal);
}
};
lookupThread = new Thread(lookupRun, "lookupThread");
lookupThread.start();
}
參考:http://www.java2s.com, Swing and Thread for length operation
沒有留言:
張貼留言