package helloworld; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Accordion; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TitledPane; import javafx.scene.layout.StackPane; import javafx.stage.Stage; /** * * @author jcambon */ public class TestAccordion extends Application { private int rowIndex = 0; /** * @param args the command line arguments */ public static void main(String[] args) { Application.launch(TestAccordion.class, (java.lang.String[]) null); } @Override public void start(Stage primaryStage) { TitledPane titledPane = new TitledPane(); titledPane.setContent(new Label("Test")); titledPane.setExpanded(true); TitledPane titledPane2 = new TitledPane(); titledPane2.setContent(new Button("Test")); Accordion accordion = new Accordion(); accordion.getPanes().addAll(titledPane, titledPane2); StackPane stackPane = new StackPane(); stackPane.getChildren().addAll(accordion); Scene scene = new Scene(stackPane); primaryStage.setWidth(300); primaryStage.setHeight(400); primaryStage.setScene(scene); primaryStage.setTitle("test Accordion"); primaryStage.show(); } }