In HTML5 to alight a text directly beneath an image we can use <figcaption>
.
<figure>
<img src="img.jpg" alt="my img"/>
<figcaption> Your text </figcaption>
</figure>
Now I am working on a JavaFX application and I want to alight the next directly beneath each image. In the main I have a for loop that generate those image and texts.
In the FXML I have
<HBox xmlns:fx="http://javafx.com/fxml" fx:controller="sample.AudioButtonController" >
<padding>
<Insets topRightBottomLeft="30" />
</padding>
<children>
<ImageView
fitHeight="120" fitWidth="120" fx:id="image" onMousePressed="#mousePressed">
</ImageView>
<Text fx:id="text"/>
</children>
</HBox>
The text shows in front of each image. I want to align ehe text exactly under each image.
How to do that?
This is how it looks right now :