javafx.scene.control.Button.setMaxHeight()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(134)

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

Button.setMaxHeight介绍

暂无

代码示例

代码示例来源:origin: torakiki/pdfsam

public BrowsableField() {
  HBox.setHgrow(textField, Priority.ALWAYS);
  this.getStyleClass().add("browsable-field");
  validableContainer = new HBox(textField);
  validableContainer.getStyleClass().add("validable-container");
  textField.getStyleClass().add("validable-container-field");
  browseButton = new Button(DefaultI18nContext.getInstance().i18n("Browse"));
  browseButton.getStyleClass().addAll(Style.BROWSE_BUTTON.css());
  browseButton.prefHeightProperty().bind(validableContainer.heightProperty());
  browseButton.setMaxHeight(USE_PREF_SIZE);
  browseButton.setMinHeight(USE_PREF_SIZE);
  HBox.setHgrow(validableContainer, Priority.ALWAYS);
  textField.validProperty().addListener((o, oldValue, newValue) -> {
    if (newValue == ValidationState.INVALID) {
      validableContainer.getStyleClass().addAll(Style.INVALID.css());
    } else {
      validableContainer.getStyleClass().removeAll(Style.INVALID.css());
    }
  });
  textField.focusedProperty().addListener(
      (o, oldVal, newVal) -> validableContainer.pseudoClassStateChanged(SELECTED_PSEUDOCLASS_STATE, newVal));
  getChildren().addAll(validableContainer, browseButton);
}

代码示例来源:origin: torakiki/pdfsam

public PasswordFieldPopupContent() {
  getStyleClass().setAll("pdfsam-input-password-content");
  passwordField.setPromptText(DefaultI18nContext.getInstance().i18n("Enter the user password"));
  Button doneButton = FontAwesomeIconFactory.get().createIconButton(FontAwesomeIcon.UNLOCK,
      DefaultI18nContext.getInstance().i18n("Unlock"));
  doneButton.getStyleClass().addAll(Style.BUTTON.css());
  doneButton.prefHeightProperty().bind(passwordField.heightProperty());
  doneButton.setMaxHeight(USE_PREF_SIZE);
  doneButton.setMinHeight(USE_PREF_SIZE);
  doneButton.setOnAction(e -> requestLoad());
  passwordField.setOnAction(e -> requestLoad());
  getChildren().addAll(passwordField, doneButton);
}

代码示例来源:origin: stackoverflow.com

apMain.getChildren().add(btn2);
btn2.setMaxWidth(Double.MAX_VALUE);
btn2.setMaxHeight(Double.MAX_VALUE);

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

button.setMaxHeight(Double.MAX_VALUE);
button.setMaxWidth(Double.MAX_VALUE);
button.setAlignment(Pos.CENTER_LEFT);

相关文章