package test.scenegraph.app; import javafx.application.Application; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.Accordion; import javafx.scene.control.Label; import javafx.scene.control.TitledPane; import javafx.scene.layout.BorderPane; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; import javafx.stage.Stage; public class ShortAppWithoutDependencies5111 extends Application { public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage stage) { Pane mainContainer = new Pane(); BorderPane pane = new BorderPane(); pane.setLayoutX(50); pane.setLayoutY(50); pane.setStyle("-fx-border-color: red;"); mainContainer.getChildren().add(pane); pane.setMaxSize(200, 200); pane.setPrefSize(200, 200); pane.setBottom(createControl()); pane.setTop(createControl()); stage.setScene(new Scene(mainContainer, 400, 400)); stage.show(); } private Node createControl() { TitledPane pane1 = new TitledPane(); pane1.setGraphic(new Label("title 1\nLong text long text")); pane1.setContent(new Rectangle(100, 40, Color.SKYBLUE)); TitledPane pane2 = new TitledPane(); pane2.setGraphic(new Label("title 2\nLong text long text")); pane2.setContent(new Rectangle(100, 40, Color.BLUEVIOLET)); Accordion acc = new Accordion(); acc.getPanes().addAll(pane1, pane2); acc.setExpandedPane(pane2); pane2.setAnimated(false); acc.setFocusTraversable(false); return acc; } }