I have a label with style class “test” in my javafx application.
I wanted to add white border around this label, so in the css file I tried:
-fx-border-width: 2;
-fx-border-color: white;
but that didnt worked so then i tried to add:
-fx-border-style: solid;
but that didnt worked either, following javafx css reference I didn’t find anything useful.
what am I doing wrong?
Can you try:
it should print something like
Is your css class printing too after styleClass=label … ?
Or can you remove css class of the label and try setting the label style in code directly by:
if you can see the changes then maybe you are unintentionally overriding css class definiton in css file. Check it.