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

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

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

Button.setMaxWidth介绍

暂无

代码示例

代码示例来源:origin: speedment/speedment

bar.setMaxWidth(Double.MAX_VALUE);
message.setMaxWidth(Double.MAX_VALUE);
cancel.setMaxWidth(128);
VBox.setVgrow(message, Priority.ALWAYS);

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

import javafx.scene.control.Button;
import javafx.scene.layout.VBox;

public class VerticalButtonBar extends VBox {

  public VerticalButtonBar() {
    setFillWidth(true);
  }

  public void addButton(Button button) {
    button.setMaxWidth(Double.MAX_VALUE);
    getChildren().add(button);
  }

}

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

Button btn2 = new Button("", ivMain);
apMain.getChildren().add(btn2);
btn2.setMaxWidth(Double.MAX_VALUE);
btn2.setMaxHeight(Double.MAX_VALUE);

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

public void onResume() {
  super.onResume();
  final Button btn = ((AlertDialog) getDialog()).getButton(DialogInterface.BUTTON_NEUTRAL);
  if (btn != null) {
    if (Build.VERSION.SDK_INT >= 21) {
      DisplayMetrics metrics = getResources().getDisplayMetrics();
      int maxWidth = (metrics.widthPixels / 3);
      btn.setSingleLine(false);
      btn.setMaxWidth(maxWidth);
      btn.setMaxLines(2);
      btn.setEllipsize(TextUtils.TruncateAt.END);
      // something in the above code reverts the allCaps
      btn.setAllCaps(true);
    }
}

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

private void updateButtons() {
  
  moveToTarget.getStyleClass().add("move-to-target-button");
  moveToTargetAll.getStyleClass().add("move-to-target-all-button");
  moveToSource.getStyleClass().add("move-to-source-button");
  moveToSourceAll.getStyleClass().add("move-to-source-all-button");
  moveToTarget.setMaxWidth(Double.MAX_VALUE);
  moveToTargetAll.setMaxWidth(Double.MAX_VALUE);
  moveToSource.setMaxWidth(Double.MAX_VALUE);
  moveToSourceAll.setMaxWidth(Double.MAX_VALUE);
  getSourceListView().itemsProperty().addListener(
      it -> bindMoveAllButtonsToDataModel());
  getTargetListView().itemsProperty().addListener(
      it -> bindMoveAllButtonsToDataModel());
  getSourceListView().selectionModelProperty().addListener(
      it -> bindMoveButtonsToSelectionModel());
  getTargetListView().selectionModelProperty().addListener(
      it -> bindMoveButtonsToSelectionModel());
  bindMoveButtonsToSelectionModel();
  bindMoveAllButtonsToDataModel();
  moveToTarget.setOnAction(evt -> moveToTarget());
  moveToTargetAll.setOnAction(evt -> moveToTargetAll());
  moveToSource.setOnAction(evt -> moveToSource());
  moveToSourceAll.setOnAction(evt -> moveToSourceAll());
}

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

button.getStyleClass().addAll("command-link-button"); //$NON-NLS-1$
button.setMaxHeight(Double.MAX_VALUE);
button.setMaxWidth(Double.MAX_VALUE);
button.setAlignment(Pos.CENTER_LEFT);

相关文章

微信公众号

最新文章

更多