Example usage for javafx.scene.control TextArea TextArea

List of usage examples for javafx.scene.control TextArea TextArea

Introduction

In this page you can find the example usage for javafx.scene.control TextArea TextArea.

Prototype

public TextArea(String text) 

Source Link

Document

Creates a TextArea with initial text content.

Usage

From source file:net.thirdy.blackmarket.controls.Dialogs.java

public static void showAbout() {
    Alert alert = new Alert(AlertType.INFORMATION);
    alert.setGraphic(new Region());
    alert.setTitle("Blackmarket " + BlackmarketApplication.VERSION);
    alert.setContentText("");
    alert.setHeaderText("");

    TextArea textArea = new TextArea("Copyright 2015 Vicente de Rivera III" + "\r\n"
            + "\r\n http://thirdy.github.io/blackmarket" + "\r\n"
            + "\r\n This program is free software; you can redistribute it and/or"
            + "\r\n modify it under the terms of the GNU General Public License"
            + "\r\n as published by the Free Software Foundation; either version 2"
            + "\r\n of the License, or (at your option) any later version." + "\r\n"
            + "\r\n This program is distributed in the hope that it will be useful,"
            + "\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of"
            + "\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the"
            + "\r\n GNU General Public License for more details." + "\r\n"
            + "\r\n You should have received a copy of the GNU General Public License"
            + "\r\n along with this program; if not, write to the Free Software"
            + "\r\n Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA." + "\r\n");
    textArea.setEditable(false);/*from   w  w w  . j  av a 2  s. c  o  m*/
    textArea.setWrapText(true);

    Hyperlink website = new Hyperlink("Visit Blackmarket Homepage");
    website.setOnAction(e -> {
        try {
            SwingUtil.openUrlViaBrowser("http://thirdy.github.io/blackmarket/");
        } catch (BlackmarketException ex) {
            logger.error(ex.getMessage(), ex);
        }
    });

    Hyperlink exwebsite = new Hyperlink("Visit Exile Tools Homepage");
    exwebsite.setOnAction(e -> {
        try {
            SwingUtil.openUrlViaBrowser("http://exiletools.com/");
        } catch (BlackmarketException ex) {
            logger.error(ex.getMessage(), ex);
        }
    });

    VBox content = new VBox(new ImageView(new Image("/images/blackmarket-logo.png")), new Label(
            "Blackmarket is fan-made software for Path of Exile but is not affiliated with Grinding Gear Games in any way."),
            new Label("A few tips:"), new Label("CTRL + Space - hot key to slide the search control pane"),
            new Label("CTRL + Enter - hot key to run the search"),
            new Label("Advance mode grants you power overwhelming of Elastic Search"),
            new Label("For more information and updates,"), website,
            new Label("Blackmarket uses Exile Tools Shop Indexer Elastic Search API:"), exwebsite,
            new Label("Comics by /u/gallio"),
            new Label("Blackmarket is 100% Free and Open Source Software under GPLv2:"), textArea);
    content.setSpacing(8);
    alert.getDialogPane().setContent(content);
    alert.showAndWait();

}

From source file:jlotoprint.MainViewController.java

public static void loadAboutWindow() {

    //setup/*from   w  ww. jav a2 s. c om*/
    Dialog dialog = new Dialog<>();
    dialog.getDialogPane().getButtonTypes().add(ButtonType.CLOSE);
    dialog.setTitle("About JLotoPanel");
    dialog.setHeaderText("JLotoPanel v1.0");
    ImageView icon = new ImageView("file:resources/icon.png");
    icon.setSmooth(true);
    icon.setFitHeight(48.0);
    icon.setFitWidth(48.0);
    dialog.setGraphic(icon);
    dialog.initModality(Modality.APPLICATION_MODAL);
    dialog.initOwner(JLotoPrint.stage.getScene().getWindow());
    //content
    GridPane grid = new GridPane();
    grid.setPadding(new Insets(10, 10, 0, 10));

    //text
    TextArea textArea = new TextArea("For more info, please visit: https://github.com/mbppower/JLotoPanel");
    textArea.setWrapText(true);
    grid.add(textArea, 0, 0);
    dialog.getDialogPane().setContent(grid);

    dialog.showAndWait();
}

From source file:jlotoprint.MainViewController.java

public static void showExceptionAlert(String message, String details) {
    Alert alert = new Alert(Alert.AlertType.ERROR, message, ButtonType.OK);
    alert.initModality(Modality.APPLICATION_MODAL);
    alert.initOwner(JLotoPrint.stage.getScene().getWindow());
    TextArea textArea = new TextArea(details);
    textArea.setEditable(false);//from  ww  w.j a va 2  s  .  c  om
    textArea.setWrapText(true);

    GridPane grid = new GridPane();
    grid.setPadding(new Insets(10, 10, 0, 10));
    grid.add(textArea, 0, 0);

    //set content
    alert.getDialogPane().setExpandableContent(grid);
    alert.showAndWait();
}

From source file:de.perdoctus.ebikeconnect.gui.MainWindowController.java

public void showAbout() throws IOException {
    Alert alert = new Alert(Alert.AlertType.INFORMATION);
    alert.initOwner(tabPane.getScene().getWindow());
    alert.initModality(Modality.WINDOW_MODAL);
    alert.setWidth(640);// ww  w  .  j  av a 2s.c  o m
    alert.setTitle(rb.getString("application-name"));
    alert.setHeaderText(rb.getString("application-name") + " Version " + rb.getString("app-version"));

    final String aboutInfo = IOUtils.toString(getClass().getResourceAsStream("/about-info.txt"), "UTF-8");
    alert.setContentText(aboutInfo);

    final String licenseInfo = IOUtils.toString(getClass().getResourceAsStream("/license-info.txt"), "UTF-8");

    final Label label = new Label(rb.getString("licenses"));
    final TextArea licenses = new TextArea(licenseInfo);
    licenses.setMaxWidth(Double.MAX_VALUE);
    licenses.setEditable(false);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(licenses, 0, 1);

    alert.getDialogPane().setExpandableContent(expContent);
    alert.show();

}

From source file:org.noroomattheinn.visibletesla.OverviewController.java

@FXML
void detailsButtonHandler(ActionEvent event) {
    AnchorPane pane = new AnchorPane();
    VehicleState car = vtVehicle.vehicleState.get();
    String info = vtVehicle.getVehicle().toString() + "\nFirmware Version: " + car.version
            + "\nRemote Start Enabled: " + vtVehicle.getVehicle().remoteStartEnabled() + "\nCalendar Enabled: "
            + vtVehicle.getVehicle().calendarEnabled() + "\nNotifications Enabled: "
            + vtVehicle.getVehicle().notificationsEnabled() + "\n--------------------------------------------"
            + "\nLow level information: " + vtVehicle.getVehicle().getUnderlyingValues() + "\nVehicle UUID: "
            + vtVehicle.getVehicle().getUUID() + "\nApp UUID: " + app.getAppID() + "\n";

    TextArea t = new TextArea(info);
    pane.getChildren().add(t);//from  w w  w . j a v a  2  s . c om
    Dialogs.showCustomDialog(app.stage, pane, "Detailed Vehicle Description", "Details", DialogOptions.OK,
            null);
}

From source file:com.github.drbookings.ui.controller.BookingDetailsController.java

private void addCheckInNote(final Pane content, final BookingBean be) {
    final VBox b = new VBox();
    b.getChildren().add(new Text("Check-in Note"));
    final TextArea ta0 = new TextArea(be.getCheckInNote());
    ta0.setWrapText(true);//from w w  w  . j a v a 2  s. co m
    ta0.setPrefHeight(80);
    b.getChildren().add(ta0);
    booking2CheckInNote.put(be, ta0);
    content.getChildren().add(b);

}

From source file:de.pixida.logtest.designer.automaton.AutomatonNode.java

@Override
public Node getConfigFrame() {
    // TODO: Remove code redundancies; element creating methods have been created in class AutomatonEdge and should be centralized!
    final ConfigFrame cf = new ConfigFrame("State properties");

    final int nameInputLines = 1;
    final TextArea nameInput = new TextArea(this.name);
    nameInput.setPrefRowCount(nameInputLines);
    nameInput.setWrapText(true);//from w  w  w .j av  a 2  s . c  o m
    nameInput.textProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> {
        this.setName(newValue);
        this.getGraph().handleChange();
    });
    cf.addOption("Name", nameInput);

    final int descriptionInputLines = 3;
    this.createTextAreaInput(descriptionInputLines, cf, "Description", this.getDescription(),
            newValue -> this.setDescription(newValue));

    final VBox typeAttributes = new VBox();
    final ToggleGroup flagToggleGroup = new ToggleGroup();
    typeAttributes.getChildren()
            .add(this.createRadioButtonForType(null, "None (intermediate node)", flagToggleGroup));
    typeAttributes.getChildren().add(this.createRadioButtonForType(Type.INITIAL, "Initial", flagToggleGroup));
    final RadioButton successOption = this.createRadioButtonForType(Type.SUCCESS, "Success", flagToggleGroup);
    typeAttributes.getChildren().add(successOption);
    typeAttributes.getChildren().add(this.createRadioButtonForType(Type.FAILURE, "Failure", flagToggleGroup));
    cf.addOption("Type", typeAttributes);

    final CheckBox waitCheckBox = new CheckBox("Active");
    waitCheckBox.setSelected(this.wait);
    waitCheckBox.setOnAction(event -> {
        this.setWait(waitCheckBox.isSelected());
        this.getGraph().handleChange();
    });
    cf.addOption("Wait", waitCheckBox);

    final int expressionInputLines = 1;
    final TextArea successCheckExpInput = new TextArea(this.successCheckExp);
    successCheckExpInput.setStyle("-fx-font-family: monospace");
    successCheckExpInput.setPrefRowCount(expressionInputLines);
    successCheckExpInput.setWrapText(false);
    successCheckExpInput.textProperty()
            .addListener((ChangeListener<String>) (observable, oldValue, newValue) -> {
                this.setSuccessCheckExp(newValue);
                this.getGraph().handleChange();
            });
    successCheckExpInput.disableProperty().bind(successOption.selectedProperty().not());
    cf.addOption("Script expression to verify if node is successful", successCheckExpInput);

    this.createEnterAndLeaveScriptConfig(cf);

    return cf;
}

From source file:com.github.drbookings.ui.controller.BookingDetailsController.java

private void addCheckOutNote(final Pane content, final BookingBean be) {
    final VBox b = new VBox();
    b.getChildren().add(new Text("Check-out Note"));
    final TextArea ta0 = new TextArea(be.getCheckOutNote());
    ta0.setWrapText(true);/*from   w w  w .j  a v  a 2s .c o m*/
    ta0.setPrefHeight(80);
    b.getChildren().add(ta0);
    booking2CheckOutNote.put(be, ta0);
    content.getChildren().add(b);

}

From source file:Testing.TestMain.java

public static void grid(Stage stage) {
    GridPane grid = new GridPane();
    grid.setHgap(8);//from w  w w  .  j a v a2 s.  c  om
    grid.setVgap(8);
    grid.setPadding(new Insets(5));

    Text mp3FileNameT, trackNoT, titleT, artistsT, lengthT, albumT, yearT, genreT, commentsT;

    mp3FileNameT = new Text("Filename:");
    trackNoT = new Text("Track Number:");
    titleT = new Text("Title:");
    artistsT = new Text("Artists:");
    lengthT = new Text("Track Length:");
    albumT = new Text("Album:");
    yearT = new Text("Year:");
    genreT = new Text("Genere:");
    commentsT = new Text("Comments/Lyrics: ");

    TextField mp3FileNameTF, trackNoTF, titleTF, artistsTF, lengthTF, albumTF, yearTF, genreTF;
    TextArea commentsTF;

    mp3FileNameTF = new TextField("");
    trackNoTF = new TextField("");
    titleTF = new TextField("");
    artistsTF = new TextField("");
    lengthTF = new TextField("");
    albumTF = new TextField("");
    yearTF = new TextField("");
    genreTF = new TextField("");
    commentsTF = new TextArea("");

    grid.addColumn(0, mp3FileNameT, trackNoT, titleT, artistsT, lengthT, albumT, yearT, genreT, commentsT);
    grid.addColumn(1, mp3FileNameTF, trackNoTF, titleTF, artistsTF, lengthTF, albumTF, yearTF, genreTF,
            commentsTF);
    grid.setAlignment(Pos.TOP_LEFT);
    Scene scene = new Scene(grid, 500, 500);

    stage.setTitle("Grid Test");
    stage.setScene(scene);
    stage.show();
}

From source file:pah9qdmoviereviews.MovieReviewsFXMLController.java

public void displayExceptionAlert(Exception ex) {
    Alert alert = new Alert(Alert.AlertType.ERROR);
    alert.setTitle("Exception");
    alert.setHeaderText("An Exception Occurred!");
    alert.setContentText(/*from  w  ww. j a  v a  2  s  .  co  m*/
            "An exception occurred.  View the exception information below by clicking Show Details.");

    // Create expandable Exception.
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    ex.printStackTrace(pw);
    String exceptionText = sw.toString();

    Label label = new Label("The exception stacktrace was:");

    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);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(textArea, 0, 1);

    // Set expandable Exception into the dialog pane.
    alert.getDialogPane().setExpandableContent(expContent);

    alert.showAndWait();
}