8 Replies Latest reply: Feb 25, 2013 12:25 PM by JPeredaDnr RSS

    SplitPane not resizable

      I have an interface that I have distributed several SplitPane but want these SplitPane not be resized or modified.

      How I can do?

      It is worth saying that the split pane is built with FXML.

      Thanks in advance
        • 1. Re: SplitPane not resizable
          Use a VBox or an HBox instead of a SplitPane.
          • 2. Re: SplitPane not resizable
            I understand what you say but when I started building the GUI, was totally ignorant of Java FX and I built my entire GUI with Split-pane (as in the video Issuetrackinglite).

            However, the implications of making the interface with another layout are something serious.

            There is some other way to get what I want without having to remove the split pane?
            • 3. Re: SplitPane not resizable
              Any idea?
              • 4. Re: SplitPane not resizable
                Would placing a transparent node over the SplitPane work?
                • 5. Re: SplitPane not resizable
                  how do I do that?
                  • 6. Re: SplitPane not resizable
                    Sample for making a split pane which is not resizable.
                    I'll leave it up to you to transfer the concepts and apply them to your fxml based UI.
                    import java.util.*;
                    import javafx.application.Application;
                    import javafx.scene.*;
                    import javafx.scene.control.*;
                    import javafx.scene.layout.StackPane;
                    import javafx.stage.Stage;
                    public class StaticSplitPaneExample extends Application {
                      public static void main(String[] args) { launch(args); }
                      @Override public void start(Stage stage) throws Exception {
                        SplitPane split = createSplitPane();
                        stage.setScene(new Scene(new Group(split)));
                      private SplitPane createSplitPane() {
                        SplitPane split = new SplitPane();
                        split.setDividerPositions(0.3, 0.6, 0.9);
                        split.setMinSize(500, 200);
                        return split;
                      private void disableDividers(SplitPane split) {
                        for (Node divider:  split.lookupAll(".split-pane-divider")) {
                      private StackPane createStackedButton(String buttonText) {
                        final StackPane stack = new StackPane();
                        stack.getChildren().add(new Button(buttonText));
                        stack.setStyle("-fx-background-color: cornsilk;");
                        return stack;
                    Associated css file to remove handles from dividers.
                    /** static-split.css */
                    .static-split .split-pane *.horizontal-grabber { -fx-background-color: transparent; }
                    .static-split .split-pane *.vertical-grabber   { -fx-background-color: transparent; }
                    • 7. Re: SplitPane not resizable
                      thank you very much ... worked very well
                      • 8. Re: SplitPane not resizable
                        Hi, I've found really interesting your solution to lock the splitpane, as there's no public access to SplitPaneSkin$ContentDivider.

                        As you've pointed out in your code, you must call disableDividers method after showing the stage, otherwise lookupAll(".split-pane-divider") returns an empty set.

                        I had to display a locked splitpane in a complex scene only when the user selected it, so after loading the splitpane on the scene I called disableDividers(), but without success.

                        I was going to ask you for any clue on this, but as usually happens, writting the question I've found the answer..., so I post it in case anyone faces the same problem.

                        Just put the call in the JavaFX Application Thread, as it's related with the UI update:
                        private void disableDividers(final SplitPane split){
                           Platform.runLater(new Runnable() {
                                public void run() {
                                    for(Node div: split.lookupAll(".split-pane-divider")){