5

Is it possible to set the appearance of non-editable text fields in css? I want non-editable text fields to look like labels. I couldn't find any answers to this (or similar) question, I tried this:

.text-input:editable {
    -fx-background-color: transparent;
}

But that didn't work, obviously.

user1009569
  • 477
  • 6
  • 22
  • You might find the answer to this related question interesting: [How do I create an editable Label in javafx 2.2](http://stackoverflow.com/questions/25572398/how-do-i-create-an-editable-label-in-javafx-2-2). That question has more requirements than simple styling so the answer is more complicated than what you need. – jewelsea Feb 24 '15 at 00:23

1 Answers1

6
.text-input:readonly {
    -fx-background-color: transparent;
}

Should've checked JavaFX CSS reference before asking a question!

user1009569
  • 477
  • 6
  • 22