Reputation: 4050
I've solved the problem to bring an icon image into the header of a TitledPane
like this:
<TitledPane fx:id="x2" text="Strukturen">
<graphic>
<ImageView >
<image>
<Image url="@/de/myres/icons/arrow-out.png" />
</image>
</ImageView>
</graphic>
<content>
<AnchorPane id="Content" minHeight="0.0" minWidth="0.0"
prefHeight="180.0" prefWidth="200.0" />
</content>
</TitledPane>
This looks like the following:
As you can see, it looks not very nice when the arrow for collapsing and this icon are shown beside each other directly.
How can i achieve to get the icon to the right side of the title bar?
Upvotes: 1
Views: 1064
Reputation: 3511
You could leave the TitledPane text blank and set the icon node to be an HBox containing a Label on the left and an ImageView on the right.
Upvotes: 2