javafx.stage.Window.sizeToScene()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中javafx.stage.Window.sizeToScene()方法的一些代码示例,展示了Window.sizeToScene()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.sizeToScene()方法的具体详情如下:
包路径:javafx.stage.Window
类名称:Window
方法名:sizeToScene

Window.sizeToScene介绍

暂无

代码示例

代码示例来源:origin: com.bitplan.gui/com.bitplan.javafx

/**
 * set the Content (since setContent of DialogPane is final this function has a different name)
 * this is a work around to have room for a help button so a grid is interwoven between the dialogpane
 * and the content we'd like to show
 * @param parent
 */
public void setContentNode(Node parent) {
 if (contentNode!=null)
  gridPane.getChildren().remove(contentNode);
 gridPane.add(parent, 0, 0);
 contentNode=parent;
 // resize the dialog
 // https://stackoverflow.com/a/31208445/1497139
 this.wizard.getPrivateDialog().getDialogPane().getScene().getWindow().sizeToScene();
}

代码示例来源:origin: org.controlsfx/controlsfx

wizard.sizeToScene();

代码示例来源:origin: PhoenicisOrg/phoenicis

/**
 * Initializes the components used in the {@link ErrorDialog}
 */
private void initialise() {
  contentTextProperty().bind(Bindings.createStringBinding(
      () -> Optional.ofNullable(getException()).map(Exception::getMessage).orElse(null), exception));
  getDialogPane().setExpandableContent(createExpandableContent());
  // ensure that the dialog resizes correctly when the expanded state changes
  getDialogPane().expandedProperty().addListener(observable -> Platform.runLater(() -> {
    getDialogPane().requestLayout();
    final Window window = getDialogPane().getScene().getWindow();
    window.sizeToScene();
  }));
  getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
}

代码示例来源:origin: org.tentackle/tentackle-fx

alert.getDialogPane().requestLayout();
 Window w = alert.getDialogPane().getScene().getWindow();
 w.sizeToScene();
}));

相关文章