Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javafx 2.0 adding border to Label

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?

like image 628
bennyl Avatar asked May 11 '12 09:05

bennyl


1 Answers

Can you try:

System.out.println(label);

it should print something like

Label@1858c80c[styleClass=label]

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:

label.setStyle("-fx-border-color: white;");

if you can see the changes then maybe you are unintentionally overriding css class definiton in css file. Check it.

like image 191
Uluk Biy Avatar answered Sep 28 '22 06:09

Uluk Biy