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

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

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

Button.setTextAlignment介绍

暂无

代码示例

代码示例来源: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: torakiki/pdfsam

public ClosePane(EventHandler<ActionEvent> handler) {
    setAlignment(Pos.CENTER_RIGHT);
    getStyleClass().addAll(Style.CONTAINER.css());
    Button closeButton = new Button(DefaultI18nContext.getInstance().i18n("Close"));
    closeButton.getStyleClass().addAll(Style.BUTTON.css());
    closeButton.setTextAlignment(TextAlignment.CENTER);
    closeButton.setOnAction(ofNullable(handler).orElse(defaultHandler));
    getChildren().add(closeButton);
  }
}

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

private HBox buildFooter() {
  Button closeButton = new Button(DefaultI18nContext.getInstance().i18n("Close"));
  closeButton.getStyleClass().addAll(Style.BUTTON.css());
  closeButton.setTextAlignment(TextAlignment.CENTER);
  closeButton.setOnAction(e -> eventStudio().broadcast(activeteCurrentModule()));
  HBox footer = new HBox(closeButton);
  footer.getStyleClass().addAll(Style.CLOSE_FOOTER.css());
  return footer;
}

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

public HidingPane() {
    Button closeButton = new Button(DefaultI18nContext.getInstance().i18n("Close"));
    closeButton.getStyleClass().addAll(Style.BUTTON.css());
    closeButton.setTextAlignment(TextAlignment.CENTER);
    closeButton.setOnAction(e -> this.setVisible(false));
    HBox bottom = new HBox(closeButton);
    bottom.setAlignment(Pos.CENTER_RIGHT);
    bottom.getStyleClass().addAll(Style.CONTAINER.css());
    super.setBottom(bottom);
  }
}

相关文章

微信公众号

最新文章

更多