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

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

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

Window.setHeight介绍

暂无

代码示例

代码示例来源:origin: org.copper-engine/copper-monitoring-client

@Override
public void run() {
 Window dialog = previewPane.getScene().getWindow();
 
 double currWidth = dialog.getWidth();
 double currHeight = dialog.getHeight();
 dialog.setWidth(Math.max(currWidth, 20 + previewPane.getLayoutX() + previewPane.getPrefWidth()));
 dialog.setHeight(20 + currHeight + previewPane.getPrefHeight());
 updatePreview();
}

代码示例来源:origin: com.miglayout/miglayout-javafx

/** Checks the parent window/popup if its size is within parameters as set by the LC.
 */
private void adjustWindowSize()
{
  BoundSize wBounds = layoutConstraints.getPackWidth();
  BoundSize hBounds = layoutConstraints.getPackHeight();
  Scene scene = getScene();
  Window window = scene != null ? scene.getWindow() : null;
  if (window == null || wBounds == BoundSize.NULL_SIZE && hBounds == BoundSize.NULL_SIZE)
    return;
  Parent root = scene.getRoot();
  double winWidth = window.getWidth();
  double winHeight = window.getHeight();
  double prefWidth = root.prefWidth(-1);
  double prefHeight = root.prefHeight(-1);
  FXContainerWrapper container = new FXContainerWrapper(root);
  double horIns = winWidth - scene.getWidth();
  double verIns = winHeight - scene.getHeight();
  double targetW = constrain(container, winWidth, prefWidth, wBounds) + horIns;
  double targetH = constrain(container, winHeight, prefHeight, hBounds) + verIns;
  double x = window.getX() - ((targetW - winWidth) * (1 - layoutConstraints.getPackWidthAlign()));
  double y = window.getY() - ((targetH - winHeight) * (1 - layoutConstraints.getPackHeightAlign()));
  window.setX(x);
  window.setY(y);
  window.setWidth(targetW);
  window.setHeight(targetH);
}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

if( getScene() != null && getScene().getWindow() != null ) {
  Window w = getScene().getWindow();
  getScene().getWindow().setHeight(Util.unsignedConstraintValue(w.getHeight(), getMinHeight(), getMaxHeight()));

代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls

if( getScene() != null && getScene().getWindow() != null ) {
  Window w = getScene().getWindow();
  getScene().getWindow().setHeight(Util.unsignedConstraintValue(w.getHeight(), getMinHeight(), getMaxHeight()));

相关文章