WaitingRoomsManagerController.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:JavaFX_Game_Client 作者:
/**
 * 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();
        }

    });
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号