在操作时,我向 jms 主题发送消息以处理数据,并且我有一个回调方法,当数据准备好并加载 TableView 时会调用该方法。
public void onEnter(ActionEvent actionEvent) throws IOException, InterruptedException {
new Thread() {
public void run() {
Platform.runLater(() -> {
progressIndicator.setVisible(true);
scrollPane.setDisable(true);
});
// Construct the message and publish it to a topic
};
}.start();
}
}
public void callBackMethod(List<Object> list ) {
progressIndicator.setVisible(false);
scrollPane.setDisable(false);
//load data in the table
}
这就是我想要的,但是如果消息传递系统端出现问题怎么办,回调永远不会被调用,并且 UI 组件将永远被禁用。
任何改进这一点的建议都会有所帮助。