package controls; import com.sun.javafx.runtime.VersionInfo; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Accordion; import javafx.scene.control.Button; import javafx.scene.control.TitledPane; import javafx.scene.layout.HBox; import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; import javafx.stage.Stage; public class DoAccordion2 extends Application { @Override public void start(Stage stage) { stage.setTitle(VersionInfo.getRuntimeVersion()); TitledPane pane1 = new TitledPane(); pane1.setText("title 1\nLong text long text"); pane1.setContent(new Rectangle(100, 40, Color.SKYBLUE)); TitledPane pane2 = new TitledPane(); pane2.setText("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); // commenting any of next three lines removes issue pane2.setAnimated(false); pane1.setFocusTraversable(false); pane2.setFocusTraversable(false); HBox root = new HBox(5); Button btn = new Button("Long text long text"); root.getChildren().addAll(acc, btn); stage.setScene(new Scene(root, 300, 300)); stage.show(); } public static void main(String[] args) { launch(DoAccordion2.class, args); } }