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

x33g5p2x  于2022-01-23 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(246)

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

Label.setTextFill介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

private void swapLabelsColor(Label lbl1, Label lbl2) {
  Paint color = lbl1.getTextFill();
  lbl1.setTextFill(lbl2.getTextFill());
  lbl2.setTextFill(color);
}

代码示例来源:origin: jfoenixadmin/JFoenix

void init() {
  calendarPlaceHolder.setOpacity(1);
  if(unit.get() == TimeUnit.HOURS){
    selectedHourLabel.setTextFill(Color.rgb(255, 255, 255, 0.87));
  }else{
    selectedMinLabel.setTextFill(Color.rgb(255, 255, 255, 0.87));
  }
}

代码示例来源:origin: jfoenixadmin/JFoenix

void init() {
  calendarPlaceHolder.setOpacity(1);
  selectedDateLabel.setTextFill(Color.WHITE);
  selectedYearLabel.setTextFill(Color.rgb(255, 255, 255, 0.67));
  yearsListView.setOpacity(0);
  yearsListView.setVisible(false);
}

代码示例来源:origin: jfoenixadmin/JFoenix

protected BorderPane createCalendarMonthLabelPane() {
  monthYearLabel = new Label();
  monthYearLabel.getStyleClass().add(SPINNER_LABEL);
  monthYearLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 13));
  monthYearLabel.setTextFill(DEFAULT_COLOR);
  BorderPane monthContainer = new BorderPane();
  monthContainer.setMinHeight(50);
  monthContainer.setCenter(monthYearLabel);
  monthContainer.setPadding(new Insets(2, 12, 2, 12));
  return monthContainer;
}

代码示例来源:origin: jfoenixadmin/JFoenix

selectedHourLabel.setTextFill(Color.WHITE);
selectedHourLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 42));
selectedHourLabel.setOnMouseClicked((click) -> unit.set(TimeUnit.HOURS));
selectedMinLabel.setTextFill(fadedColor);
selectedMinLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 42));
selectedMinLabel.setOnMouseClicked((click) -> unit.set(TimeUnit.MINUTES));
separatorLabel.setTextFill(fadedColor);
separatorLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 42));
periodPMLabel.setTextFill(fadedColor);
periodPMLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 14));
periodPMLabel.setOnMouseClicked((click) -> period.set("PM"));
periodAMLabel.setTextFill(fadedColor);
periodAMLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 14));
periodAMLabel.setOnMouseClicked((click) -> period.set("AM"));
  periodAMLabel.setTextFill(Color.WHITE);
} else {
  periodPMLabel.setTextFill(Color.WHITE);

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

@Override
public void initialize(URL location, ResourceBundle resources) {
  title.setTextFill(Color.web("#45a6fc")); // TODO Use styleClass instead
  header.setText("Component Explorer");
  final RootItem root = new RootItem(speedment);
  root.getChildren().addAll(components());
  tree.setRoot(root);
  close.setOnAction(newCloseHandler());
}

代码示例来源:origin: jfoenixadmin/JFoenix

selectedYearLabel.setTextFill(Color.rgb(255, 255, 255, 0.67));
selectedYearLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 14));
selectedDateLabel.setTextFill(Color.WHITE);
selectedDateLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 32));

代码示例来源:origin: jfoenixadmin/JFoenix

label.setFont(Font.font(ROBOTO, FontWeight.BOLD, 12));
label.setTextFill(val == time.getMinute() ?
  Color.rgb(255, 255, 255, 0.87) : Color.rgb(0, 0, 0, 0.87));
selectedMinLabel.textProperty().addListener((o, oldVal, newVal) -> {
  if (Integer.parseInt(newVal) == Integer.parseInt(label.getText())) {
    label.setTextFill(Color.rgb(255, 255, 255, 0.87));
  } else {
    label.setTextFill(Color.rgb(0, 0, 0, 0.87));

代码示例来源:origin: jfoenixadmin/JFoenix

label.setTextFill(((val == time.getHour() % 12 || (val == 12 && time.getHour() % 12 == 0)) && !is24HourView) ?
  Color.rgb(255, 255, 255, 0.87) : Color.rgb(0, 0, 0, 0.87));
selectedHourLabel.textProperty().addListener((o, oldVal, newVal) -> {
  if (Integer.parseInt(newVal) == Integer.parseInt(label.getText())) {
    label.setTextFill(Color.rgb(255, 255, 255, 0.87));
  } else {
    label.setTextFill(Color.rgb(0, 0, 0, 0.87));
  label.setTextFill((val == time.getHour() % 24 || (val == 0 && time.getHour() % 24 == 0) && is24HourView) ?
    Color.rgb(255, 255, 255, 0.54) : Color.rgb(0, 0, 0, 0.54));
  selectedHourLabel.textProperty().addListener((o, oldVal, newVal) -> {
    if (Integer.parseInt(newVal) == Integer.parseInt(label.getText())) {
      label.setTextFill(Color.rgb(255, 255, 255, 0.54));
    } else {
      label.setTextFill(Color.rgb(0, 0, 0, 0.54));

代码示例来源:origin: jfoenixadmin/JFoenix

private void updateColor() {
  final ColorPicker colorPicker = (ColorPicker) getSkinnable();
  Color color = colorPicker.getValue();
  // update picker box color
  Color circleColor = color == null ? Color.WHITE : color;
  Circle colorCircle = new Circle();
  colorCircle.setFill(circleColor);
  colorCircle.setLayoutX(colorBox.getWidth() / 4);
  colorCircle.setLayoutY(colorBox.getHeight() / 2);
  colorBox.getChildren().add(colorCircle);
  Timeline animateColor = new Timeline(new KeyFrame(Duration.millis(240),
    new KeyValue(colorCircle.radiusProperty(),
      200,
      Interpolator.EASE_BOTH)));
  animateColor.setOnFinished((finish) -> {
    JFXNodeUtils.updateBackground(colorBox.getBackground(), colorBox, colorCircle.getFill());
    colorBox.getChildren().remove(colorCircle);
  });
  animateColor.play();
  // update label color
  displayNode.setTextFill(circleColor.grayscale().getRed() < 0.5 ? Color.valueOf(
    "rgba(255, 255, 255, 0.87)") : Color.valueOf("rgba(0, 0, 0, 0.87)"));
  if (colorLabelVisible.get()) {
    displayNode.setText(JFXNodeUtils.colorToHex(circleColor));
  } else {
    displayNode.setText("");
  }
}

代码示例来源:origin: jfoenixadmin/JFoenix

for (Node tabNode : tabs.lookupAll(".tab")) {
  for (Node node : tabNode.lookupAll(".tab-label")) {
    ((Label) node).setTextFill(fontColor);

代码示例来源:origin: com.jfoenix/jfoenix

private void swapLabelsColor(Label lbl1, Label lbl2) {
  Paint color = lbl1.getTextFill();
  lbl1.setTextFill(lbl2.getTextFill());
  lbl2.setTextFill(color);
}

代码示例来源:origin: com.jfoenix/jfoenix

void init() {
  calendarPlaceHolder.setOpacity(1);
  if(unit.get() == TimeUnit.HOURS){
    selectedHourLabel.setTextFill(Color.rgb(255, 255, 255, 0.87));
  }else{
    selectedMinLabel.setTextFill(Color.rgb(255, 255, 255, 0.87));
  }
}

代码示例来源:origin: com.jfoenix/jfoenix

void init() {
  calendarPlaceHolder.setOpacity(1);
  selectedDateLabel.setTextFill(Color.WHITE);
  selectedYearLabel.setTextFill(Color.rgb(255, 255, 255, 0.67));
  yearsListView.setOpacity(0);
  yearsListView.setVisible(false);
}

代码示例来源:origin: com.intuit.karate/karate-core

public void refresh() {
  textArea.clear();
  text = "";
  resultLabel.setText(idle);
  resultLabel.setTextFill(Color.web("#8c8c8c"));
}

代码示例来源: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: ch.sahits.game/OpenPatricianJavaFX

private void updateOtherPlayerShield(Group g, INavigableVessel vessel) {
  g.getChildren().remove(shield);
  shield = createShield(vessel);
  g.getChildren().add(shield);
  Color shieldColor = getShieldBaseColor(vessel);
  Color textColor = calculateContrastColor(shieldColor);
  shipGroupSize.setTextFill(textColor);
}

代码示例来源:origin: com.jfoenix/jfoenix

protected BorderPane createCalendarMonthLabelPane() {
  monthYearLabel = new Label();
  monthYearLabel.getStyleClass().add(SPINNER_LABEL);
  monthYearLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 13));
  monthYearLabel.setTextFill(DEFAULT_COLOR);
  BorderPane monthContainer = new BorderPane();
  monthContainer.setMinHeight(50);
  monthContainer.setCenter(monthYearLabel);
  monthContainer.setPadding(new Insets(2, 12, 2, 12));
  return monthContainer;
}

代码示例来源:origin: com.cedarsoft.commons/javafx

public DragButton(@Nonnull String text) {
 setCursor(Cursor.W_RESIZE);
 rectangle = new Rectangle();
 rectangle.setFill(Color.GRAY);
 rectangle.setArcHeight(5.0);
 rectangle.setArcWidth(5.0);
 line = new Line();
 label = Components.label(text);
 label.setTextFill(Color.WHITE);
 getChildren().addAll(rectangle, line, label);
}

代码示例来源:origin: com.guigarage/ui-basics

public static Label createLabel(String text, Character icon) {
  Label label = new Label(text);
  label.setTextFill(Color.GRAY);
  label.setFont(new Font(20));
  label.setGraphicTextGap(6);
  Text iconT = createIconText(icon, 24);
  iconT.setFill(Color.GRAY);
  label.setGraphic(iconT);
  return label;
}

相关文章