运行下边这段代码时,报这个错误Thread.run()line:notavailable[localvariablesunavailable]请高手指教!/***Startathreadthatwillcalltheconstruct
method*andthenexit....
运行下边这段代码时,报这个错误Thread.run() line: not available [local variables unavailable]
请高手指教!
/**
* Start a thread that will call the construct
method
* and then exit.
*/
public SwingWorker() {
final Runnable doFinished = new Runnable() {
public void run() {
finished();
}
};
Runnable doConstruct = new Runnable() {
public void run() {
try {
setValue(construct());
} finally {
threadVar.clear();
}
SwingUtilities.invokeLater(doFinished);
}
};
Thread t = new Thread(doConstruct);
threadVar = new ThreadVar(t);
}
展开