CSS can be used to style a UI created with JavaFX. It is based on CSS version 2.1. This tag should be used for questions about styling JavaFX Nodes using CSS.
Questions tagged [javafx-css]
141 questions
0
votes
1 answer
In JavaFX, how can I switch skins using CSS?
What is the correct place to define a Skin via CSS in JavaFX? Say I have a very simple custom control...
public class ActionLink extends Control {
private final StringProperty text = new SimpleStringProperty();
public final StringProperty…

Ryan J
- 2,502
- 5
- 31
- 41
-1
votes
1 answer
I'm trying to change the background color of textarea in scenebuilder, but the outline color is changing
In similar questions, it was written that if you set the background-color style, the background color will change, but in my case the outline changes
Scene Builder configuration:
Result:
And for some reason the outline is not for the entire…

skver
- 3
- 3
-1
votes
1 answer
Set text alignment inside the TextArea using css is not working
I am trying to set the text alignment inside a textArea for center, left, and right in the controllers but none is working.
My current code is simple, for the center method I use this inside the method:
textArea.setStyle("-fx-text-alignment:…
user10222681
-1
votes
2 answers
JavaFX CSS two-pixel border
Help me with JavaFX CSS. I need to create a border width of 2 pixels:
Up pixel - #000
Down pixel - #5d5c5e
I think I need to use a linear-gradient, but I don't know how to do it.

Bif Lee
- 61
- 3
-2
votes
1 answer
Why does JavaFX Node have wrong sizes in initialize method after css is applied?
I have a VBox that have several AnchorPane. I decided to add css style to these AnchorPane: -fx-border-width. But the VBox is inside another "main" AnchorPane, and main AnchorPane is inside the ScrollPane. If I'm adding css to elements, not all the…

MicroKlizma
- 1
- 1
-3
votes
1 answer
How to style checkbox's css in-line using setStyle()
Let me keep it short.
So. I know you can style the CheckBox's .box in css like:
.check-box > .box {
-fx-background-color: white;
}
but I'm not sure how to in-line. Please just provide an example code. Thanks.
user10558779