0

I'm creating UI for my application using Scenebuilder.

I created simple layout.

enter image description here

But even after setting minimal size everywhere, still window can be reduced to this.

enter image description here

The .fxml file contains

    <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="400.0" minWidth="600.0" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1">
   <children>
      <MenuBar layoutY="2.0" minHeight="25.0" minWidth="600.0" prefHeight="25.0" prefWidth="600.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
        <menus>
          <Menu mnemonicParsing="false" text="File">
            <items>
              <MenuItem mnemonicParsing="false" text="Close" />
            </items>
          </Menu>
        </menus>
      </MenuBar>
      <SplitPane dividerPositions="0.85" layoutY="23.0" minHeight="377.0" minWidth="600.0" prefHeight="377.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="23.0">
        <items>
          <AnchorPane minHeight="377.0" minWidth="505.0" prefHeight="377.0" prefWidth="505.0">
               <children>
                  <TextFlow minHeight="377.0" minWidth="505.0" prefHeight="377.0" prefWidth="505.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
               </children>
            </AnchorPane>
          <AnchorPane minHeight="200.0" minWidth="87.0" prefHeight="200.0" prefWidth="87.0">
               <children>
                  <Pane minHeight="200.0" minWidth="87.0" prefHeight="200.0" prefWidth="87.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
               </children>
            </AnchorPane>
        </items>
      </SplitPane>
   </children>
</AnchorPane>

I've tried to set minimal size through different elements. Or set it to match pref_size. But with no results.

How can I set that one pane (or other element) cannot be smaller that some number ?

jmt
  • 719
  • 1
  • 9
  • 28
  • 2
    Possible duplicate of [JavaFX How to set max/min window size?](http://stackoverflow.com/questions/12686120/javafx-how-to-set-max-min-window-size) – Itai Jul 12 '16 at 14:10
  • 1
    You are talking about _window_ size constraints, which should be set on the `Stage`. See linked question and answer. – Itai Jul 12 '16 at 14:10
  • Thank you very much, its working now. But i'm keen to know, if its possible to set min constraint for stage through Scenebuilder (I'm using Scenebuilder 8 from Gluon) – jmt Jul 13 '16 at 08:19

0 Answers0