Example usage for javafx.scene.control TitledPane TitledPane

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

Introduction

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

Prototype

public TitledPane() 

Source Link

Document

Creates a new TitledPane with no title or content.

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    stage.setTitle("TitledPane");
    Scene scene = new Scene(new Group(), 450, 250);
    scene.setFill(Color.GHOSTWHITE);

    TitledPane gridTitlePane = new TitledPane();
    GridPane grid = new GridPane();
    grid.setVgap(4);//from  ww  w.  j ava2 s.com
    grid.setPadding(new Insets(5, 5, 5, 5));
    grid.add(new Label("To: "), 0, 0);
    grid.add(new TextField(), 1, 0);
    grid.add(new Label("Cc: "), 0, 1);
    grid.add(new TextField(), 1, 1);
    grid.add(new Label("Subject: "), 0, 2);
    grid.add(new TextField(), 1, 2);
    grid.add(new Label("Attachment: "), 0, 3);
    grid.add(new Label("static value"), 1, 3);
    gridTitlePane.setText("Grid");
    gridTitlePane.setContent(grid);

    HBox hbox = new HBox(10);
    hbox.setPadding(new Insets(20, 0, 0, 20));
    hbox.getChildren().setAll(gridTitlePane);

    Group root = (Group) scene.getRoot();
    root.getChildren().add(hbox);
    stage.setScene(scene);
    stage.show();
}

From source file:org.kordamp.javatrove.example04.util.ApplicationEventHandler.java

@Handler
public void handleThrowable(ThrowableEvent event) {
    Platform.runLater(() -> {/*from w w w . j  a va 2  s . c om*/
        TitledPane pane = new TitledPane();
        pane.setCollapsible(false);
        pane.setText("Stacktrace");
        TextArea textArea = new TextArea();
        textArea.setEditable(false);
        pane.setContent(textArea);

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        event.getThrowable().printStackTrace(new PrintStream(baos));
        textArea.setText(baos.toString());

        Alert alert = new Alert(Alert.AlertType.ERROR);
        alert.setTitle("Error");
        alert.setHeaderText("An unexpected error occurred");
        alert.getDialogPane().setContent(pane);
        alert.showAndWait();
    });
}

From source file:cz.lbenda.dataman.rc.DatamanApp.java

/** Add new pane to right */
public TitledPane addToRight(String title, Node node) {
    TitledPane titlePane = new TitledPane();
    titlePane.setContent(node);/*from  w ww .  jav  a 2  s  .c  om*/
    titlePane.setText(title);
    rightPane.getPanes().add(titlePane);
    return titlePane;
}