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
0 answers
JavaFX external CSS through client-server mechanism
I am using a client-server protocol using Netty. I am having a pre-loader and the main application in my Java program.
My question is, is it possible to fetch all needed CSS and FXML files from the server (using the pre-loader) and use them after…

Displee
- 670
- 8
- 20
0
votes
1 answer
how to implement multi imageView select holding control button in javaFX
In my JAVAFX application, i am having imageviews in a tilepane , i want to implement the multi select like functionality like in android for images . I tried adding border style to the imageView on click event but that didnt work. Is there any way…
0
votes
0 answers
JavaFX - HTMLEditor - change the size of a combobox list-view
I am trying to change the width of the Font size combobox's listview of the HTMLEditor Component.
Here is what i tried already:
editor.lookup( "font-size-menu-button" ).lookup( "list-view" )
.setStyle( "-fx-pref-width: " +…

Marcel
- 1,509
- 1
- 17
- 39
0
votes
3 answers
how to add same background color for all pane in javafx?
I want to maintain single background color(black) for all panes, and for all views. i don't want write css for every view. i am using only vbox and hbox mostly. and very few table views. is there any easy way to write css once and apply to all.…

Gaali Prabhakar
- 583
- 6
- 23
0
votes
1 answer
How do you set JavaFX TabPane CSS in code?
https://stackoverflow.com/a/10615258/529411
I would like to add a background color to my tabpane dynamically (depending on certain conditions). How can I achieve this from code? One option is to assign he tab a specific ID which has the associated…

Darth Ninja
- 1,049
- 2
- 11
- 34
0
votes
0 answers
Whats is the right JavaFX CSS syntax when a class is selected?
I have seen the recommended syntax as below -
.A:selected {
-fx-background-color: green;
}
But that didnt work for me. I got it working using -
:selected .A {
-fx-background-color: green;
}
Also, what is the syntax to apply the same…

Darth Ninja
- 1,049
- 2
- 11
- 34
0
votes
2 answers
Sharing JavaFX css values across multiple classes
How can I share settings across multiple classes? I need to apply certain styles to my tableview cells (depending on the enum value displayed) and would prefer not to repeat the values as below -
.A {
-fx-background-color: red;
}
.B {
…

Darth Ninja
- 1,049
- 2
- 11
- 34
0
votes
1 answer
Create complex JavaFX Background with CSS/Code
Is it possible to create such a background in JavaFX either with CSS or programatically, but dynamically without an Image-File.
This is the image I want to create:

Dmitrij D
- 25
- 3
0
votes
0 answers
Line with arrowhead
I'm currently using javafx.scene.shape.Line to visualize fancy diagrams.
Is there a way to add an arrow head to a Line? I was hoping it would be possible using CSS. But unfortunately I cannot find it in the CSS Reference Guide.
Impossible ?

bvdb
- 22,839
- 10
- 110
- 123
0
votes
1 answer
How to get rid of white border around JavaFX Textview
I have a white border around my TextArea that I cannot get rid of
Heres the code:
textArea = new TextArea();
textArea.getStyleClass().add("textArea");
textArea.setWrapText(true);
And the css:
.textArea{
-fx-background-insets: 0 0 0 0,…

Josh Beaver
- 127
- 8
- 18
0
votes
2 answers
How to pass JavaFX variable into CSS style?
I want to take selected color and change background color of button.
private void handleItemBackAction(ActionEvent eve)
{
System.out.println("You clicked Set Background Color of Item!");
java.awt.Color…

Drashti Pandya
- 348
- 1
- 5
- 15
0
votes
1 answer
How to set style for first level child in treetableview
I want to set the top border just for all the first child so that for one child the data looks in one row.
but I'm unable to set the id for those rows. I tried the following code but it didn't help.
final PseudoClass firstRowClass =…

Harshita Sethi
- 2,035
- 3
- 24
- 46
0
votes
2 answers
Align Text in TextFlow to center - JavaFX FXML & CSS
At the moment I have a piece of text defined with Text in my FXML. It is also located inside a TextFlow which is inside a ScrollPane. I have tried aligning the text to center in the FXML itself and in css but still doesn't seen to be working. Here…

Josh Beaver
- 127
- 8
- 18
0
votes
2 answers
css: How to change row color of a table after its been selected and clicked away
I have .css when the row is selected which is fine.
However when I click off the row it changes the row color grey with a black font, is there any way to edit this css?
.table-view {
-fx-base: transparent;
-fx-control-inner-background:…

Davidaj
- 235
- 3
- 14
0
votes
2 answers
Set opacity to ScrollPane
I have a GridPane with buttons inside of a ScrollPane. When the needed number of buttons is not enough to fill the ScrollPane's maximum size, it looks like the image below. I need to set this blank spot to the background color of the Pane that…

Juan
- 1,949
- 1
- 15
- 22