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

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

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

Label.setWrapText介绍

暂无

代码示例

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

public JFXDefaultChip(JFXChipView<T> view, T item) {
    super(view, item);
    JFXButton closeButton = new JFXButton(null, new SVGGlyph());
    closeButton.getStyleClass().add("close-button");
    closeButton.setOnAction((event) -> view.getChips().remove(item));

    String tagString = null;
    if (getItem() instanceof String) {
      tagString = (String) getItem();
    } else {
      tagString = view.getConverter().toString(getItem());
    }
    Label label = new Label(tagString);
    label.setWrapText(true);
    root = new HBox(label, closeButton);
    getChildren().setAll(root);
    label.setMaxWidth(100);
  }
}

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

toast.setMinWidth(Control.USE_PREF_SIZE);
toast.getStyleClass().add("jfx-snackbar-toast");
toast.setWrapText(true);
toast.setText(message);
StackPane toastContainer = new StackPane(toast);

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

protected static Label createValueLabel() {
    Label ret = new Label();
    ret.getStyleClass().add("info-property-value");
    ret.setWrapText(true);
    return ret;
  }
}

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

errorLabel.setWrapText(true);

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

KeywordsTab() {
  VBox content = new VBox();
  content.getStyleClass().add("info-props");
  setText(DefaultI18nContext.getInstance().i18n("Keywords"));
  setClosable(false);
  keywords.setWrapText(true);
  keywords.getStyleClass().add("info-property-value");
  content.getChildren().add(keywords);
  ScrollPane scroll = new ScrollPane(content);
  scroll.setFitToHeight(true);
  scroll.setFitToWidth(true);
  setContent(scroll);
  eventStudio().addAnnotatedListeners(this);
}

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

chart.setTitle("really long title...........\n.............and some more ");
 Label l = (Label)chart.lookup(".chart-title");
 l.setWrapText(true);

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

/**
 * @{inheritedDoc}
 */
@Override
public void build(IInputComponentWrapper inputComponentWrapper) {
 super.build(inputComponentWrapper);
 label.setWrapText(true);
 label.getStyleClass().add("form-value-label");
}

代码示例来源:origin: com.dlsc.formsfx/formsfx-core

private Label asLabel(String text, String styleClass) {
  Label label = new Label(text);
  label.setWrapText(true);
  label.getStyleClass().add(styleClass);
  return label;
}

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

/**
 * @{inheritedDoc}
 */
@Override
public void build(IInputComponentWrapper inputComponentWrapper) {
 super.build(inputComponentWrapper);
 label.setWrapText(true);
 label.getStyleClass().add("form-value-label");
}

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

/**
 * Constructor
 */
public WizardStepHeader() {
 getStyleClass().add("wizard-step-listViewPaneHeader");
 title.getStyleClass().addAll("wizard-step-listViewPaneHeader-title", "h5");
 title.setWrapText(true);
 getChildren().add(title);
}

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

/**
 * {@inheritDoc}
 */
@Override
public Node getDisplayNode(List<IListFormValue> values) {
 final Label valueLabel = new Label();
 valueLabel.setWrapText(true);
 valueLabel.setOpacity(0.44);
 if (values != null && values.isEmpty()) {
  valueLabel.setText(values.get(0).getDisplayedValue());
 }
 return valueLabel;
}

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

/**
 * {@inheritDoc}
 */
@Override
public Node getDisplayNode(List<IListFormValue> values) {
 final Label valueLabel = new Label();
 valueLabel.setWrapText(true);
 valueLabel.setOpacity(0.44);
 if (values != null && values.isEmpty()) {
  valueLabel.setText(values.get(0).getDisplayedValue());
 }
 return valueLabel;
}

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

/**
 * {@inheritDoc}
 */
@Override
public Node getDisplayNode(List<IListFormValue> values) {
 final Label valueLabel = new Label();
 valueLabel.setWrapText(true);
 valueLabel.setMaxWidth(100);
 valueLabel.getStyleClass().add("ep-list-form-data-value");
 if (values != null && !values.isEmpty()) {
  valueLabel.setText(values.get(0).getDisplayedValue());
 }
 return valueLabel;
}

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

/**
 * @{inheritedDoc}
 */
@Override
public void build(IInputComponentWrapper inputComponentWrapper) {
 super.build(inputComponentWrapper);
 label.setText("value to be processed");
 label.setText("In work - Released");
 label.setWrapText(true);
 label.getStyleClass().add("form-value-label");
}

代码示例来源:origin: PhoenicisOrg/phoenicis

private void populateRepositoryLegend() {
  this.priorityHint = new Label(tr(
      "The value in front of each repository is its priority. The higher the priority is, the more important the scripts inside the repository are."));
  this.priorityHint.setWrapText(true);
  this.priorityHint.setPadding(new Insets(10));
}

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

/**
 * @{inheritedDoc}
 */
@Override
public void build(IInputComponentWrapper inputComponentWrapper) {
 super.build(inputComponentWrapper);
 String value = (String) ReflectionUIUtils.invokeGetterOn(controller.getModel(), inputComponentWrapper.getAttributePath());
 userAccountOperation.doOperation(value, this::handleResult);
 label.setWrapText(true);
 label.getStyleClass().add("form-value-label");
}

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

/**
 * Constructor
 */
public NoContentPane() {
 getStyleClass().add("no-content-pane");
 noContentMessage.setWrapText(true);
 noContentMessage.setStyle("no-content-pane-message");
 managedProperty().bind(visibleProperty());
 setAlignment(Pos.CENTER);
 NodeHelper.setHVGrow(this);
}

代码示例来源:origin: org.tentackle/tentackle-fx

/**
 * Workaround for the bug that messages are not completely displayed if text is wrapped.
 *
 * @param alert the alert dialog
 * @param message the text message
 */
protected void setAlertMessage(Alert alert, String message) {
 alert.setHeaderText(null);
 Label textLabel = new Label();    // replace with non-wrapping label!
 textLabel.setWrapText(false);
 textLabel.setText(message);
 alert.getDialogPane().setContent(textLabel);
 alert.setResizable(true);   // RT-38998
}

代码示例来源: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 build(IInputComponentWrapper inputComponentWrapper) {
 super.build(inputComponentWrapper);
 label.textProperty().unbind();
 label.setWrapText(true);
 NodeHelper.styleClassAddAll(label, getConfiguration(), "viewStyleClass", "form-info-value");
 // convert saved date to displayed date
 String currval = (String) inputComponentWrapper.getConverter().fromString(inputComponentWrapper.getCurrentInternalValue());
 label.setText(currval);
}

相关文章