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

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

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

Label.setTooltip介绍

暂无

代码示例

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

@Override
public Node createLabel() {
  final Label l = new Label(label);
  l.setTooltip( new Tooltip(tooltip) );
  return l;
}

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

TreeTableColumn<String, ArrayList<String>> col = new TreeTableColumn<>();
 Label label = new Label(ent.getValue());
 col.setGraphic(label);
 label.setTooltip(new Tooltip("Tooltip text goes here"));

代码示例来源:origin: com.speedment.tool/tool-propertyeditor

@Override
public Node createLabel() {
  final Label l = new Label(label);
  l.setTooltip( new Tooltip(tooltip) );
  return l;
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxplatform-components

/**
 * @param operationResult
 */
protected void handleResult(IOperationResult operationResult) {
 final ObjectModel account = (ObjectModel) operationResult.rootData();
 label.setText(account.getName());
 label.setTooltip(new Tooltip(account.getName()));
}

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

/**
 * Dispaly current value
 */
protected void displayValue() {
 String currVal = getCurrentDisplayText();
 Label currValLabel = new Label();
 currentValuesPresenter.getChildren().clear();
 currentValuesPresenter.getChildren().add(currValLabel);
 if (StringUtils.isNotBlank(currVal)) {
  String[] t = currVal.split(File.separator);
  String val = t[t.length - 1];
  currValLabel.setText(val);
  currValLabel.setMaxWidth(100);
  currValLabel.setTooltip(new Tooltip(currVal));
 }
}

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

label.setTooltip(new Tooltip(description));

代码示例来源: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: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * @{inheritedDoc}
 */
@Override
public void build(IInputComponentWrapper inputComponentWrapper) {
 super.build(inputComponentWrapper);
 final String labelKey = configuration.getPropertyValue(XMLConstants.LABEL);
 label.setText(controller.getLocalised(labelKey));
 label.setWrapText(true);
 NodeHelper.styleClassAddAll(label, getConfiguration(), "viewStyleClass", "form-info-value");
 label.setTooltip(new Tooltip(controller.getLocalised(labelKey)));
}

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

/**
 * @{inheritedDoc}
 */
@Override
public void displayError() {
 if(isNotValid()) {
  String errorMessage = getFirstErrorMessage();
  if (errorMessage == null) {
   errorMessage = "Invalid Field";
  }
  buildHelpTextAndErrorText();
  errorText.setText(errorMessage);
  errorText.setTooltip(new Tooltip(errorMessage));
  errorText.setVisible(true);
  state = VLConstraintState.NOT_VALID;
  input.setInErrorState();
  if (!inputContainer.getChildren().contains(errorText)) {
   inputContainer.getChildren().add(errorText);
  }
 }
 else {
  errorText.setVisible(false);
 }
}

代码示例来源:origin: io.github.factoryfx/javafxDataEditing

private Label addLabelContent(GridPane gridPane, int row, Attribute<?,?> attribute) {
    String mnemonicLabelText=uniformDesign.getLabelText(attribute);
    if (mnemonicLabelText!=null){
      mnemonicLabelText="_"+mnemonicLabelText;
    }
    Label label = new Label(mnemonicLabelText);
    label.setMnemonicParsing(true);
    label.setWrapText(true);
//        label.setTextOverrun(OverrunStyle.CLIP);
    GridPane.setMargin(label, new Insets(0, 9, 0, 0));
    StackPane pane = new StackPane();
    pane.setPadding(new Insets(5,3,5,3));
    pane.setAlignment(Pos.CENTER_LEFT);
    pane.getChildren().add(label);
    gridPane.add(pane, 0, row);

    if (row%2==0) {
      pane.setStyle("-fx-background-color: " + highlightBackground + ";");
    }
    String tooltip=uniformDesign.getTooltipText(attribute);
    if (!Strings.isNullOrEmpty(tooltip)) {
      label.setTooltip(new Tooltip(tooltip));
    }

    return label;
  }
  final static String highlightBackground = "#FCFCFC";

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

private static void updatePseudoState(Label statusIcon, Status status) {
  statusIcon.pseudoClassStateChanged(error, status.getState() == State.ERROR);
  statusIcon.pseudoClassStateChanged(warning, status.getState() == State.WARNING);
  statusIcon.pseudoClassStateChanged(ok, status.getState() == State.OK);
  statusIcon.pseudoClassStateChanged(cancel, status.getState() == State.CANCEL);
  statusIcon.autosize();
  if( statusIcon.getTooltip() == null ) {
    if( status.getState() != State.OK ) {
      statusIcon.setTooltip(new Tooltip(status.getMessage()));
    }
  } else {
    statusIcon.getTooltip().setText(status.getMessage());
  }
}

代码示例来源: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;
}

相关文章