本文整理了Java中javafx.scene.control.Label.setAlignment()
方法的一些代码示例,展示了Label.setAlignment()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.setAlignment()
方法的具体详情如下:
包路径:javafx.scene.control.Label
类名称:Label
方法名:setAlignment
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
selectedHourLabel.setOnMouseClicked((click) -> unit.set(TimeUnit.HOURS));
selectedHourLabel.setMinWidth(49);
selectedHourLabel.setAlignment(Pos.CENTER_RIGHT);
timeLabel.set(selectedHourLabel);
代码示例来源:origin: jfoenixadmin/JFoenix
colorPickerGrid = new JFXColorGrid();
colorPickerGrid.getChildren().get(0).requestFocus();
customColorLabel.setAlignment(Pos.CENTER_LEFT);
customColorLink.setPrefWidth(colorPickerGrid.prefWidth(-1));
customColorLink.setAlignment(Pos.CENTER);
代码示例来源:origin: jfoenixadmin/JFoenix
sizeLabel.setMinWidth(25);
sizeLabel.setPrefWidth(sizeCalculator.getWidth());
sizeLabel.setAlignment(Pos.BASELINE_RIGHT);
代码示例来源:origin: nl.cloudfarming.client/calendar-api
public RegionWithTitle(String title) {
this.title = title;
label = new Label(title);
label.getStyleClass().add("calendar-bar-title");
getChildren().add(label);
expandedStateLabel = new Label();
expandedStateLabel.getStyleClass().add("calendar-expand-state");
expandedStateLabel.setMinSize(STATE_LABEL_SIZE, STATE_LABEL_SIZE);
expandedStateLabel.setPrefSize(STATE_LABEL_SIZE, STATE_LABEL_SIZE);
expandedStateLabel.setAlignment(Pos.CENTER);
setExpanded(true);
getChildren().add(expandedStateLabel);
}
代码示例来源:origin: com.cedarsoft.commons/javafx
@Nonnull
public static Label placeholder(@Nonnull String text) {
Label placeholder = new Label(text);
placeholder.setFont(new Font(30.0));
placeholder.setTextFill(Color.gray(0.4));
placeholder.setTextAlignment(TextAlignment.CENTER);
placeholder.setAlignment(Pos.CENTER);
placeholder.setStyle("-fx-background-color: #f8f8f8");
return placeholder;
}
代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls
public LineInfo() {
this.markerLabel = new Label();
this.markerLabel.setPrefWidth(20);
this.lineText = new Label();
this.lineText.getStyleClass().add("line-ruler-text"); //$NON-NLS-1$
this.lineText.setMaxWidth(Double.MAX_VALUE);
this.lineText.setMaxHeight(Double.MAX_VALUE);
this.lineText.setAlignment(Pos.CENTER_RIGHT);
HBox.setHgrow(this.lineText, Priority.ALWAYS);
getChildren().addAll(this.markerLabel, this.lineText);
}
代码示例来源:origin: org.controlsfx/controlsfx
private Node createDecorationNode(ValidationMessage message) {
Node graphic = Severity.ERROR == message.getSeverity() ? createErrorNode() : createWarningNode();
graphic.setStyle(SHADOW_EFFECT);
Label label = new Label();
label.setGraphic(graphic);
label.setTooltip(createTooltip(message));
label.setAlignment(Pos.CENTER);
return label;
}
代码示例来源:origin: org.fxmisc.richtext/richtextfx
@Override
public Node apply(int idx) {
Val<String> formatted = nParagraphs.map(n -> format(idx+1, n));
Label lineNo = new Label();
lineNo.setFont(DEFAULT_FONT);
lineNo.setBackground(DEFAULT_BACKGROUND);
lineNo.setTextFill(DEFAULT_TEXT_FILL);
lineNo.setPadding(DEFAULT_INSETS);
lineNo.setAlignment(Pos.TOP_RIGHT);
lineNo.getStyleClass().add("lineno");
// bind label's text to a Val that stops observing area's paragraphs
// when lineNo is removed from scene
lineNo.textProperty().bind(formatted.conditionOnShowing(lineNo));
return lineNo;
}
代码示例来源:origin: org.jrebirth.af.showcase/fonticon
private Node buildTile(final IconFont iconFont) {
final VBox box = new VBox();
box.setAlignment(Pos.CENTER);
box.setPrefSize(100, 50);
final Label icon = new Label();
iconFont.use(icon);
icon.setPadding(new Insets(4));
icon.setAlignment(Pos.CENTER);
VBox.setVgrow(icon, Priority.ALWAYS);
final Label text = new Label(iconFont.name());
text.setAlignment(Pos.BOTTOM_CENTER);
VBox.setVgrow(text, Priority.SOMETIMES);
text.setTooltip(new Tooltip(iconFont.name()));
box.getChildren().addAll(icon, text);
// box.setStyle("-fx-background-color:red;");
return box;
}
代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls
this.nameProperty.getStyleClass().addAll("preview", "resourceName"); //$NON-NLS-1$//$NON-NLS-2$
this.nameProperty.setPrefWidth(Double.MAX_VALUE);
this.nameProperty.setAlignment(Pos.CENTER);
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls
this.nameProperty.getStyleClass().addAll("preview", "resourceName"); //$NON-NLS-1$//$NON-NLS-2$
this.nameProperty.setPrefWidth(Double.MAX_VALUE);
this.nameProperty.setAlignment(Pos.CENTER);
代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay
label.setAlignment(Pos.CENTER);
if (canEnlargeCityWalls()) {
template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.cityhall.TownInfoNotice.confirm", new Object[]{}, locale.getCurrentLocal());
label.setAlignment(Pos.CENTER);
if (canHaveMoreGuards()) {
template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.cityhall.TownInfoNotice.confirm", new Object[]{}, locale.getCurrentLocal());
label.setAlignment(Pos.CENTER);
label.setOnMouseReleased((evt) -> {
if (selectionBox != null) {
label.setAlignment(Pos.CENTER);
label.setOnMouseReleased((evt) -> {
if (selectionBox != null) {
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.dialogs
messageLabel.setPrefSize(420, 56);
messageLabel.setWrapText(true);
messageLabel.setAlignment(Pos.TOP_LEFT);
progressPane.getChildren().add(messageLabel);
代码示例来源:origin: com.jfoenix/jfoenix
selectedHourLabel.setOnMouseClicked((click) -> unit.set(TimeUnit.HOURS));
selectedHourLabel.setMinWidth(49);
selectedHourLabel.setAlignment(Pos.CENTER_RIGHT);
timeLabel.set(selectedHourLabel);
代码示例来源:origin: org.controlsfx/controlsfx
titleLabel.getStyleClass().addAll("line-1"); //$NON-NLS-1$
titleLabel.setWrapText(true);
titleLabel.setAlignment(Pos.TOP_LEFT);
GridPane.setVgrow(titleLabel, Priority.NEVER);
messageLabel.getStyleClass().addAll("line-2"); //$NON-NLS-1$
messageLabel.setWrapText(true);
messageLabel.setAlignment(Pos.TOP_LEFT);
messageLabel.setMaxHeight(Double.MAX_VALUE);
GridPane.setVgrow(messageLabel, Priority.SOMETIMES);
代码示例来源:origin: org.controlsfx/controlsfx
infoLabel.setAlignment(Pos.TOP_LEFT);
infoLabel.getStyleClass().add("info"); //$NON-NLS-1$
infoLabel.textProperty().bind(control.textProperty());
代码示例来源:origin: org.controlsfx/controlsfx
title.textProperty().bind(popOver.titleProperty());
title.setMaxSize(MAX_VALUE, MAX_VALUE);
title.setAlignment(Pos.CENTER);
title.getStyleClass().add("text"); //$NON-NLS-1$
popOver.detachedProperty().or(popOver.headerAlwaysVisibleProperty())));
closeIcon.getStyleClass().add("icon"); //$NON-NLS-1$
closeIcon.setAlignment(CENTER_LEFT);
closeIcon.getGraphic().setOnMouseClicked(evt -> popOver.hide());
代码示例来源:origin: com.jfoenix/jfoenix
colorPickerGrid = new JFXColorGrid();
colorPickerGrid.getChildren().get(0).requestFocus();
customColorLabel.setAlignment(Pos.CENTER_LEFT);
customColorLink.setPrefWidth(colorPickerGrid.prefWidth(-1));
customColorLink.setAlignment(Pos.CENTER);
内容来源于网络,如有侵权,请联系作者删除!