javafx.scene.control.TextArea类的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(167)

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

TextArea介绍

暂无

代码示例

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

final TextArea textArea = new TextArea(exceptionText);
textArea.setEditable(false);
textArea.setWrapText(true);
textArea.setMaxWidth(Double.MAX_VALUE);
textArea.setMaxHeight(Double.MAX_VALUE);
GridPane.setVgrow(textArea, Priority.ALWAYS);
GridPane.setHgrow(textArea, Priority.ALWAYS);

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

if (areaConnectionUrl.getText().isEmpty()
  ||  areaConnectionUrl.getText().equals(generatedConnUrl.get())) {
    final String url = item.getConnectionUrlGenerator().from(
      TemporaryDbms.create(
    areaConnectionUrl.setText(url);
fieldName.textProperty().addListener((ob, o, n) -> recalculateFields.run());
fieldSchema.textProperty().addListener((ob, o, n) -> recalculateFields.run());
areaConnectionUrl.textProperty().addListener((ob, o, n) -> recalculateFields.run());
areaConnectionUrl.disableProperty().bind(
  enableConnectionUrl.selectedProperty().not()
);
    .orElseGet(() -> type.getDefaultDbmsName().orElseGet(fieldName::getText)));
  if (!areaConnectionUrl.getText().isEmpty()
  &&  !areaConnectionUrl.getText().equals(generatedConnUrl.get())) {
    dbms.connectionUrlProperty().setValue(
      areaConnectionUrl.getText()
    );

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

@Override
protected TextInputControl getInputControl() {
  TextArea area = new TextArea();
  area.setWrapText(true);
  return area;
}

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

main.setSpacing(50);
TextArea javafxTextArea = new TextArea();
javafxTextArea.setPromptText("JavaFX Text Area");
main.getChildren().add(javafxTextArea);
JFXTextArea jfxTextArea = new JFXTextArea();

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

this.step = step;
this.index = index;
TextArea textArea = new TextArea();
textArea.setFont(App.getDefaultFont());
textArea.setWrapText(true);
textArea.setMinHeight(0);
text = step.toString();
int lines = StringUtils.wrappedLinesEstimate(text, 30);
textArea.setText(text);
textArea.setPrefRowCount(lines);
textArea.focusedProperty().addListener((val, before, after) -> {
  if (!after) { // if we lost focus
    String temp = textArea.getText();
    if (!text.equals(temp)) {
      text = temp;

代码示例来源:origin: edu.utah.bmi.nlp/nlp-core

public void popDialog(String title, String header, String content) {
  if (guiEnabled)
    Platform.runLater(() -> {
      Dialog<String> dialog = new Dialog<>();
      dialog.setTitle(title);
      dialog.setHeaderText(header);
      TextArea textField = new TextArea();
      dialog.setHeight(400);
      dialog.setResizable(true);
      dialog.getDialogPane().setContent(textField);
      dialog.getDialogPane().getButtonTypes().add(ButtonType.OK);
      textField.setEditable(false);
      textField.setText(content);
      textField.setWrapText(true);
      dialog.showAndWait();
    });
  if(print)
    System.out.println(title+":\t"+header+":\t"+content);
}

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

GridPane.setValignment(keyLabel, VPos.TOP);
final TextArea valueLabel = new TextArea(entry.getValue().toString());
valueLabel.setWrapText(true);
valueLabel.setPrefRowCount(entry.getValue().toString().length() / 25);
valueLabel.focusedProperty().addListener((observable, oldValue, newValue) -> {
    shortcutProperties.replace(entry.getKey(), valueLabel.getText());

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

setTop(consoleLabel);
setPadding(App.PADDING_ALL);
textArea = new TextArea();
textArea.setFont(App.getDefaultFont());
textArea.setWrapText(true);
textArea.setMinHeight(0);
textArea.setPromptText(consolePlaceHolder);
text = "";
resultLabel = new Label(idle);
resultLabel.setPadding(new Insets(3.0, 0, 0, 0));
resultLabel.setFont(new Font(15));
textArea.focusedProperty().addListener((val, before, after) -> {
  if (!after) { // if we lost focus
    String temp = textArea.getText();
    if (!text.equals(temp) && !temp.trim().equals("")) {
      text = temp;

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

@Override
  protected void drawStepContent() {
    super.drawStepContent();

    TextArea licenceWidget = new TextArea(licenceText);
    licenceWidget.setLayoutX(10);
    licenceWidget.setLayoutY(100);
    licenceWidget.setMinWidth(700);
    licenceWidget.setMaxWidth(700);
    licenceWidget.setMinHeight(308);
    licenceWidget.setMaxHeight(308);
    licenceWidget.setEditable(false);

    CheckBox confirmWidget = new CheckBox(tr("I agree"));
    confirmWidget.setOnAction(event -> {
      isAgree = !isAgree;
      confirmWidget.setSelected(isAgree);
      setNextButtonEnabled(isAgree);
    });
    confirmWidget.setLayoutX(10);
    confirmWidget.setLayoutY(418);
    setNextButtonEnabled(false);

    this.addToContentPane(licenceWidget);
    this.addToContentPane(confirmWidget);
  }
}

代码示例来源:origin: org.copper-engine/copper-monitoring-client

back.getChildren().add(label);
final TextArea area = new TextArea();
area.setPrefRowCount(10);
if (e != null) {
  area.setText(Throwables.getStackTraceAsString(e));
area.setOpacity(0.4);
area.setEditable(false);
VBox.setVgrow(area, Priority.ALWAYS);
back.getChildren().add(area);
area.getStyleClass().add("consoleFont");
area.setContextMenu(menue);

代码示例来源:origin: com.aquafx-project/aquafx

textareaBox.setSpacing(10);
textareaBox.setPadding(new Insets(10));
TextArea area = new TextArea();
area.setPromptText("TextArea with promptText");
area.setPrefWidth(290);
area.setPrefHeight(50);
area.setPrefColumnCount(80);
textareaBox.getChildren().add(area);
TextArea area2 = new TextArea();
area2.setText("Disabled");
area2.setDisable(true);
area2.setPrefWidth(290);
area2.setPrefHeight(50);
textareaBox.getChildren().add(area2);
txts.getChildren().add(textareaBox);

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

/**
 * Creates the expandable content component of the {@link ErrorDialog}
 *
 * @return The expandable content component of the {@link ErrorDialog}
 */
private VBox createExpandableContent() {
  final Label label = new Label(tr("Stack trace:"));
  final TextArea textArea = new TextArea();
  textArea.setEditable(false);
  textArea.textProperty().bind(Bindings.createStringBinding(
      () -> Optional.ofNullable(getException()).map(ExceptionUtils::getFullStackTrace).orElse(null),
      exception));
  VBox.setVgrow(textArea, Priority.ALWAYS);
  final VBox container = new VBox(label, textArea);
  container.setFillWidth(true);
  return container;
}

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

private void showLicensePopup() {
  Alert licenseAlert = new Alert(AlertType.INFORMATION);
  licenseAlert.setWidth(500);
  licenseAlert.setHeaderText("License");
  ScrollPane scroll = new ScrollPane();
  try {
    scroll.setContent(new TextArea(IOUtils.toString(getClass().getResourceAsStream("LICENSE"),
        StandardCharsets.UTF_8)));
  } catch (IOException e) {
    e.printStackTrace();
  }
  licenseAlert.getDialogPane().setContent(scroll);
  licenseAlert.showAndWait();
}

代码示例来源:origin: com.powsybl/powsybl-gse-afs-ext-base

private javafx.scene.Node createListStringComponent(Parameter parameter) {
  TextArea textArea = new TextArea(((List<String>) parameter.getDefaultValue()).stream().collect(Collectors.joining(System.lineSeparator())));
  textArea.setPrefColumnCount(20);
  textArea.setPrefRowCount(5);
  textArea.textProperty().addListener((observable, oldValue, newValue) -> parametersValue.put(parameter.getName(), newValue.replace(System.lineSeparator(), ",")));
  return new VBox(5, new Label(parameter.getDescription()), textArea);
}

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

/**
 * @{inheritedDoc}
 */
@Override
public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) {
 super.buildFrom(controller, configuration);
 textArea.setPrefRowCount(2);
 // prompt
 prompt.ifPresent(e -> {
  final String val = controller.getLocalised(prompt.get());
  textArea.setPromptText(val);
 });
 // process wizardConfiguration
 final Optional<VLViewComponentXML> displayConfig = configuration.getComponentById(DISPLAY_CONFIG);
 displayConfig.ifPresent(d -> {
  d.booleanPropertyValueOf(XMLConstants.READ_ONLY).ifPresent(e -> {
   textArea.setDisable(e);
  });
  d.intPropertyValueOf(XMLConstants.COUNTER).ifPresent(e -> {
   if (e > 0) {
    // !! not for validation, for counter
    // textArea.setMaxLength(e);
   }
  });
 });
 textArea.setText(owner.getCurrentInternalValue());
 Bindings.bindBidirectional(textArea.textProperty(), owner.currentInternalValueProperty(), owner.getConverter());
}

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

@Override
  public Node createValueVisualisation() {
    TextArea textArea = new TextArea();
    textArea.textProperty().bindBidirectional(observableAttributeValue);
    textArea.disableProperty().bind(readOnly);
    return textArea;
  }
}

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

private void onExceptionSelectionChanges(LogEntry newVal) {
  logDetailsTextArea.setText(newVal == null ? "" : newVal.getStackTrace());
  handleSelectedEntry(newVal);
}

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

editableArea.getStyleClass().add("simple-textarea");
editableArea.setPrefRowCount(5);
editableArea.setPrefHeight(80);
editableArea.setWrapText(true);

代码示例来源:origin: org.copper-engine/copper-monitoring-client

logConfig.textProperty().addListener(new ChangeListener<String>() {
  @Override
  public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
resultTextarea.getStyleClass().add("consoleFont");
resultTextarea.setWrapText(false);

代码示例来源:origin: org.copper-engine/copper-monitoring-client

assert logWrapStackpane != null : "fx:id=\"logWrapStackpane\" was not injected: check your FXML file 'CustomMeasurePointResult.fxml'.";
logText.setWrapText(false);
logText.getStyleClass().add("consoleFont");
timeRange.setText("" + DEFAULT_TIME_FRAME);

相关文章