Can someone please tell me how to make the text inside a label bold in Java FXML?
<Label fx:id="LegalLabel" text= "Legal Information" GridPane.halignment="RIGHT" GridPane.rowIndex="16" />
Thank you.
Can someone please tell me how to make the text inside a label bold in Java FXML?
<Label fx:id="LegalLabel" text= "Legal Information" GridPane.halignment="RIGHT" GridPane.rowIndex="16" />
Thank you.
Give this a shot
legalLabel.setStyle("-fx-font-weight: bold;");
or try making your fxml look like this
<Label fx:id="LegalLabel" text= "Legal Information" GridPane.halignment="RIGHT" GridPane.rowIndex="16">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
Edit: try this: legalLabel.setFont(Font.font("Verdana", FontWeight.BOLD, 12));
© 2022 - 2024 — McMap. All rights reserved.
style="-fx-font-weight: bold;"
or this in your css stylesheet :.label { -fx-font-weight: bold;}
. With a light research, you should have found this. – Concertgoer