3 Replies Latest reply: Jan 2, 2013 8:08 AM by 966626 RSS

    Anchor Height inside a split pane

      I have the following code in fxml:
      <SplitPane dividerPositions="0.1" fx:id="scpContenido"
      <ComboBox fx:id="tipoDocumento" onAction="#cmbTipoDocumentoAction" prefHeight="21.0" prefWidth="138.0" VBox.vgrow="NEVER">
      <FXCollections fx:factory="observableArrayList">
      <String fx:value="Tesis" />
      <String fx:value="Ejecutorias" />
      <String fx:value="Votos" />
      <String fx:value="Acuerdos" />
      <String fx:value="Otros" />
      <String fx:value="Sentencias de otros Tribunales" />
      <String fx:value="Octava parte: Ejecutorias" />
      <String fx:value="Octava parte: Votos" />
      <String fx:value="Novena parte: Sentencias" />
      <Insets fx:id="x1" />
      <Button fx:id="btnSecuencial" mnemonicParsing="false" onAction="#btnSecuencialAction" prefHeight="21.0" prefWidth="138.0" text="%btnSecuencial" VBox.margin="$x1" VBox.vgrow="NEVER" />
      <Button fx:id="btnPorRegistro" mnemonicParsing="false" prefHeight="21.0" prefWidth="138.0" text="%btnPorRegistro" VBox.margin="$x1" VBox.vgrow="NEVER" />
      <Button fx:id="btnRecuperar" mnemonicParsing="false" prefWidth="138.0" text="%btnRecuperar" VBox.margin="$x1" VBox.vgrow="NEVER" />
      <VBox fx:id="panelBusqueda" prefHeight="295.0" prefWidth="138.0" VBox.margin="$x1" VBox.vgrow="ALWAYS" />
      <AnchorPane fx:id="panelesResultados"

      but when i add a new child inside the "panelesResultados" anchor pane it doesn't take all the height of the left side of the plit pane... when i put a Anchorpane with a TableView inside the table view doesn't show the rows...
      The question is how to set the Anchor Pane to get all the available hight on the splitpane (or the ScrollPane)??? in order to show the table view rows.
      i don't want a fix height value since i want to be a variable height window, so the number of rows will depend on the window height..
      i hope i explained myself clear.
      Greetings and thanks in advance
        • 1. Re: Anchor Height inside a split pane
          Try this
          <ScrollPane fitToHeight="true">
                <AnchorPane fx:id="panelesResultados"
                   minWidth="800" prefWidth="800" >
          And why are you use AnchorPane.topAnchor="0.0" and AnchorPane.bottomAnchor="0.0" for ScrollPane, if ScrollPane is item of SplitPane?
          • 2. Re: Anchor Height inside a split pane
            What i want to modify when the windows is resized is the height, the width is responding correctly and the minWidth is to be sure that the scrollbars are showing when the split pane left less space than the width of the Anchorpane.
            i will try fittoHeight, the AnchorPane.topAchor was a desesparete try to make the things work. Thanks in advance
            • 3. Re: Anchor Height inside a split pane
              It worked great!!! thanks a lot.