【发布时间】:2016-03-14 06:31:43
【问题描述】:
我想在其他线程中更改 UI 并尝试过这种方式-
SwingUtilities.invokeLater(new Runnable() {
public void run() {
try {
Thread.sleep(5000);
lblToast.setText(6+"");
} catch (InterruptedException ex) {
Logger.getLogger(FXMLDocumentController.class.getName())
.log(Level.SEVERE, null, ex);
}
}
});
但是这段代码不起作用。
【问题讨论】:
-
让它更具体,什么不起作用?你得到什么错误?并添加更多代码