According to the TitledPane's Substructure, the title
is a HBox
. So we can lookup it and hide then:
Platform.runLater(new Runnable() {
@Override
public void run() {
Pane title = (Pane) titledPane.lookup(".title");
if (title != null) {
title.setVisible(false);
}
}
});
It should be run in Platform.runLater(...)
after the scene constructed and rendered.