Samarek
Samarek

Reputation: 444

Set HBox as title for TitledPane

Putting a custom node as content on a TitledPane is fairly easy, but how can I set a node as the title of a TitledPane?

Can't really find anything on the subject, to a point where I start thinking it's not possible to do something other than

titledPane.setText("My title")

But that can't be, can it ?

Upvotes: 0

Views: 299

Answers (1)

fabian
fabian

Reputation: 82461

Use the graphic property of the TitledPane:

HBox hbox = ...
TitledPane titledPane = new TitledPane();
titledPane.setGraphic(hbox);

Upvotes: 2

Related Questions