【问题标题】:JFXDialog closes when clicking away单击离开时 JFXDialog 关闭
【发布时间】:2017-08-03 21:52:23
【问题描述】:

我在我的程序中使用 JFXDialog 来显示程序的主要功能正在加载。我使用 JFXSpinner 来展示这一点。问题是,当显示加载对话框时,单击对话框外的任何地方都可以将其关闭。我尝试使用设置overlayClose 的JFXDialog 的第三个构造函数,但是无论我将其设置为true 还是false,它都不会改变任何内容。

有谁知道可以做些什么来防止对话框在点击离开时关闭?

【问题讨论】:

  • 你试过了吗:your_dialog.setOverlayClose(false);

标签: java javafx jfoenix


【解决方案1】:

JFXDialog.java源文件中所写:

/**
 * indicates whether the dialog will close when clicking on the overlay or not
 *
 * @return
 */
private BooleanProperty overlayClose = new SimpleBooleanProperty(true);

public final BooleanProperty overlayCloseProperty() {
    return this.overlayClose;
}

public final boolean isOverlayClose() {
    return this.overlayCloseProperty().get();
}

public final void setOverlayClose(final boolean overlayClose) {
    this.overlayCloseProperty().set(overlayClose);
}

你应该使用yourDialog.setOverlayClose(false);

【讨论】:

    猜你喜欢
    • 2010-12-05
    • 2023-04-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-21
    • 1970-01-01
    • 2022-12-08
    • 1970-01-01
    相关资源
    最近更新 更多