I have a scene showing 3 images, and I want each of them to take a third of the width of the scene. From now, I have made 3 Pane of each 30% of it, it works. But in those Pane, I can't make my ImageView use only the width of the Pane.
<GridPane GridPane.rowIndex="1" GridPane.columnIndex="0">
<ImageView GridPane.columnIndex="0" fx:id="imgChasseur" preserveRatio="true" onMouseClicked="#handleChoixChasseur"/>
<ImageView GridPane.columnIndex="1" fx:id="imgMage" preserveRatio="true" onMouseClicked="#handleChoixMage"/>
<ImageView GridPane.columnIndex="2" fx:id="imgGuerrier" preserveRatio="true" onMouseClicked="#handleChoixGuerrier"/>
<columnConstraints>
<ColumnConstraints percentWidth="33" />
<ColumnConstraints percentWidth="33" />
<ColumnConstraints percentWidth="33" />
</columnConstraints>
<rowConstraints>
<RowConstraints percentHeight="100" />
</rowConstraints>
</GridPane>
With that sample of code, I can't see the three because they are huge, and with the 'fitWidth="100"' in the 3 ImageView, they are too small.
The way I understand it is that the 'fitWidth' works in pixels, but it's not a responsive way, so it doesn't help me very much...
The GridPane is the only Pane which seems to have percentage values, so I thought it could help me make them responsive, but it doesn't seem so. Is there a way, regardless of the Pane I should use?