Здравствуйте!
У меня есть GridPanel
3x1, требуется сделать так чтобы боковые столбцы были фиксированного размера, а центральное которое вмещает в себе ScrollPanel
должно подстраиваться под размер окна приложения. С боковыми как-то удалось решить задачу, а вот с центральной как не изменяю настройки в Scene Builder, получается так что центральный столбец увеличивается на 100% содержимого и правая ячейка уходит за пределы окна приложения.
На всякий случай, внизу прикрепил код cгенерированный Scene Builder.
Правая ячейка ушла за пределы окна
Увеличил окно, появилась правая ячейка и ScrollPane
не растянулся на всю ширину центральной ячейки
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.String?>
<?import javafx.collections.FXCollections?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ChoiceBox?>
<?import javafx.scene.control.DatePicker?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.FlowPane?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?>
<GridPane gridLinesVisible="true" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1">
<columnConstraints>
<ColumnConstraints hgrow="NEVER" minWidth="-Infinity" />
<ColumnConstraints fillWidth="false" hgrow="NEVER" minWidth="-Infinity" />
<ColumnConstraints minWidth="-Infinity" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<VBox prefHeight="760.0" prefWidth="0.0" spacing="3.0">
<children>
<Button mnemonicParsing="false">
<graphic>
<ImageView fitHeight="35.0" fitWidth="35.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../image/folder_sm.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button mnemonicParsing="false">
<graphic>
<ImageView fitHeight="35.0" fitWidth="35.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../image/length_sm.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button mnemonicParsing="false">
<graphic>
<ImageView fitHeight="35.0" fitWidth="35.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../image/center_sm.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button mnemonicParsing="false">
<graphic>
<ImageView fitHeight="35.0" fitWidth="35.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../image/pellets_sm.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button mnemonicParsing="false">
<graphic>
<ImageView fitHeight="35.0" fitWidth="35.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../image/reset_sm.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button mnemonicParsing="false">
<graphic>
<ImageView fitHeight="35.0" fitWidth="35.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../image/zoomPlus_sm.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button mnemonicParsing="false">
<graphic>
<ImageView fitHeight="35.0" fitWidth="35.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../image/actualSize_sm.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button mnemonicParsing="false">
<graphic>
<ImageView fitHeight="35.0" fitWidth="35.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../image/zoomMinus_sm.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button mnemonicParsing="false">
<graphic>
<ImageView fitHeight="35.0" fitWidth="35.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../image/save_sm.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button mnemonicParsing="false">
<graphic>
<ImageView fitHeight="35.0" fitWidth="35.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../image/screenshoot_sm.png" />
</image>
</ImageView>
</graphic>
</Button>
<Button mnemonicParsing="false">
<graphic>
<ImageView fitHeight="35.0" fitWidth="35.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../image/settings_sm.png" />
</image>
</ImageView>
</graphic>
</Button>
</children>
<padding>
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
</padding>
</VBox>
<ScrollPane hbarPolicy="ALWAYS" vbarPolicy="ALWAYS" GridPane.columnIndex="1" GridPane.halignment="LEFT" GridPane.hgrow="ALWAYS" GridPane.valignment="TOP" GridPane.vgrow="ALWAYS">
<content>
<Pane>
<children>
<ImageView fitHeight="1000.0" fitWidth="1000.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../image/2.jpg" />
</image>
</ImageView>
</children>
</Pane>
</content>
</ScrollPane>
<TabPane tabClosingPolicy="UNAVAILABLE" GridPane.columnIndex="2">
<tabs>
<Tab text="Мишень">
<content>
<VBox prefHeight="200.0" prefWidth="100.0" spacing="3.0">
<children>
<FlowPane>
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Название: " />
<TextField>
<FlowPane.margin>
<Insets top="3.0" />
</FlowPane.margin>
</TextField>
</children>
</FlowPane>
<DatePicker />
<HBox spacing="3.0" />
<HBox layoutX="13.0" layoutY="69.0" spacing="3.0" />
<GridPane hgap="3.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Пуля: " GridPane.rowIndex="1" />
<TextField GridPane.columnIndex="1" />
<ChoiceBox prefWidth="100.0" value="Метры" GridPane.columnIndex="2">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="Метры" />
<String fx:value="Ярды" />
</FXCollections>
</items>
</ChoiceBox>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Дистанция: " />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
<ChoiceBox prefWidth="100.0" value="мм" GridPane.columnIndex="2" GridPane.rowIndex="1">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="мм" />
<String fx:value="дюймы" />
</FXCollections>
</items>
</ChoiceBox>
</children>
</GridPane>
<TextArea wrapText="true">
<VBox.margin>
<Insets right="3.0" />
</VBox.margin></TextArea>
</children>
<padding>
<Insets left="3.0" />
</padding>
</VBox>
</content></Tab>
<Tab text="Статистика">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
</content>
</Tab>
<Tab text="Примечания">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
</content>
</Tab>
</tabs>
</TabPane>
</children>
</GridPane>
Столкнулся с такой проблемой, как получение данных из листаКазалось бы что всё просто, но вот не совсем