package test.scenegraph.app; import javafx.application.Application; import javafx.builders.ScrollBarBuilder; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.CheckBox; import javafx.scene.control.Label; import javafx.scene.control.Tab; import javafx.scene.control.TabPane; import javafx.scene.control.TitledPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.scene.shape.Circle; import javafx.scene.shape.Rectangle; import javafx.stage.Stage; public class ShortAppWithoutDependencies51111 extends Application { public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage stage) { Pane mainContainer = new Pane(); HBox pane = new HBox(); pane.setStyle("-fx-border-color: red;"); mainContainer.getChildren().add(pane); // pane.setMaxSize(300, 90); // pane.setPrefSize(300, 90); pane.setPadding(new Insets(24)); pane.setAlignment(Pos.BASELINE_RIGHT); pane.getChildren().add(createControl1()); pane.getChildren().add(createControl2()); // pane.getChildren().add(createControl3()); stage.setScene(new Scene(mainContainer, 500, 500)); stage.setVisible(true); } public Node createControl1() { TitledPane tpane = new TitledPane(); tpane.setTitle(new Label("Click Here!")); VBox content = new VBox(5); content.getChildren().addAll(new Label("Label")); //content.getChildren().addAll(new Label("Label"), new Button("Button"), new CheckBox("Check box")); tpane.setContent(content); tpane.setAnimated(false); return tpane; } public Node createControl2() { TabPane pane = new TabPane(); Tab tab = new Tab(); tab.setText("tab 1"); HBox content1 = new HBox(10); content1.getChildren().addAll(new Label("Label"), new Rectangle(40, 40, Color.TOMATO)); tab.setContent(content1); //Tab tab2 = new Tab(); //tab2.setText("tab 2"); //tab2.setContent(new Circle(40, Color.RED)); //pane.getTabs().addAll(tab, tab2); pane.getTabs().add(tab); pane.setFocusTraversable(false); return pane; } public Node createControl3() { return ScrollBarBuilder.create().value(45).min(0).max(100).focusTraversable(false).build(); } }