/**
* handle all popUp windows
*
* @param text
*/
public void handlePopup(String text) {
Platform.runLater(() -> {
try {
Popup popup = new Popup();
Parent parent;
parent = FXMLLoader.load(getClass().getResource("/Fxml/popup.fxml"));
ImageView imageView = (ImageView) parent.lookup("#imgMessage");
imageView.setImage(new Image(getClass().getResource("/Css/dialog-info.png").toString()));
imageView.setOnMouseClicked(event -> popup.hide());
Label lblMessage = (Label) parent.lookup("#lblMessage");
lblMessage.setText(text);
popup.setX(primaryStage.getX());
popup.setY(primaryStage.getY());
popup.getContent().add(parent);
popup.setAutoHide(true);
popup.show(primaryStage);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
});
}
WaitingRoomsManagerController.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:JavaFX_Game_Client
作者:
评论列表
文章目录