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

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

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

Button.setAlignment介绍

暂无

代码示例

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

@Override
  public Button createNode() {
    final Button btn = new Button(text, icon.view());
    btn.setTextAlignment(TextAlignment.CENTER);
    btn.setAlignment(Pos.CENTER);
    btn.setMnemonicParsing(false);
    btn.setLayoutX(10);
    btn.setLayoutY(10);
    btn.setPadding(new Insets(8, 12, 8, 12));
    btn.setOnAction(handler);
    btn.setTooltip(new Tooltip(tooltip));
    return btn;
  }
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * @{inheritedDoc}
 */
@Override
public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) {
 this.controller = (AbstractViewController) controller;
 backIcon = new Button();
 backIcon.setOnAction(e -> goBack());
 IconUtils.setHeaderNavigationBack(backIcon);
 backIcon.getStyleClass().addAll("ep-headerless-app-header-button", "hand-hover");
 backIcon.setDisable(true);
 backIcon.setVisible(true);
 backIcon.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
 backIcon.setAlignment(Pos.CENTER);
 getChildren().addAll(backIcon);
 getStyleClass().addAll("hand-hover");
 //getStyleClass().add("ep-primary-menu-with-navbar-top-toolbar");
 //getStyleClass().add("ep-primary-menu-with-navbar-toolbar");
 setAlignment(Pos.CENTER);
 setMinHeight(54);
 addEventFilter(MouseEvent.MOUSE_CLICKED, e->{
 });
}

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

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

相关文章

微信公众号

最新文章

更多