首页 > 解决方案 > 使用 com.gluonhq.charm.glisten.control.Dialog 遇到问题

问题描述

我需要用户在我的 gluon 应用程序中输入文本。所以我使用com.gluonhq.charm.glisten.control.Dialog<T>如下所示的。

        Dialog<String> dialog = new Dialog();
        dialog.setResult("");
        com.gluonhq.charm.glisten.control.TextField textField = new com.gluonhq.charm.glisten.control.TextField("");
        textField.textProperty().addListener(new ChangeListener(){
            @Override
            public void changed(ObservableValue observable, Object oldValue, Object newValue) {
                dialog.setResult((String) newValue);
            }
        });
        dialog.setContent(textField);
        Button ok = new Button("OK");
        ok.setOnAction(ev -> {
            dialog.hide();
        });
        dialog.getButtons().add(ok);
        String name = dialog.showAndWait().get();

当按下确定按钮或当我按下对话框外的某个位置时,应用程序会冻结。正如预期的那样,它可以在桌面上运行。我该如何在手机上解决这个问题?

问题似乎是因为它是从按钮侧显示的SidePopupView

标签: javafxmobiledialoggluon

解决方案


推荐阅读