Is there a way to set the title of a TitledPane to bold in Java code without using CSS?
I created a TitledPane and I want the title's font weight to be bold.
This is what I tried:
TitledPane Rootpane = new TitledPane();
Rootpane.setText("Options");
Rootpane.setStyle("-fx-background-color: #eeeeee; -fx-text-fill: #1b75bc; -fx-font-weight: bold;");
The title became bold, but unfortunately, all the other buttons within the TitledPane also became bold...
I just want to make the Title bold without using a CSS file.
Is there a way to select the title in Java Code?
I attempted this:
Rootpane.lookup(".titled-pane > .title").setStyle("-fx-font-weight: bold;");
However, I encountered an error:
Exception in thread "main" java.lang.NullPointerException