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
2
votes
1 answer
Pane Shape Modification
Ok so to make a long story short I'm trying to create a sort of chat/message system and need a small bit of assistance. I'm trying to create an arrow on my container as the one shown in the image below. The image is taken off of ControlsFX and from…

Philip Vaughn
- 606
- 6
- 20
2
votes
0 answers
How to fix ugly spacing in JavaFX chart legend
I have a JavaFX LineChart, and the spacing of the legend items is really awkward looking.
I want the item spacing to appear neater and more orderly. For example, possibly squeezing them together to make the legend size match their combined…

Bassinator
- 1,682
- 3
- 23
- 50
2
votes
1 answer
Change selection color of a JavaFX TreeTableView
I'm having a little trouble regarding FX, CSS and the TreeTableView.
I have cells containing blue Hyperlinks. Now if the cell is selected, the background becomes blue and thus the link is practically invisible. I'd now like to change the background…

Rosso
- 428
- 7
- 17
2
votes
1 answer
JavaFX: Table Row Multi-Color Border Style
I'd like to draw a custom border around certain Table Rows using JavaFX. In the following picture you can see the current state.
What I need to do is fill the blanks between the yellow lines with black lines.
My first idea was to define two styles…

noX
- 23
- 3
2
votes
0 answers
Warning: Unknown property: "my-property"
I have a Node subclass where I have defined my own CssMetaData. Let's say with this metadata my node has a my-property property. So naturally, I would use it like this in my stylesheet:
.myNode
{
my-property: 100;
}
It is definitely working.…

Jai
- 8,165
- 2
- 21
- 52
2
votes
1 answer
Can't set custom font
I'm working on a JavaFX project. I'd like to use custom font on a Label from a CSS file. I've read and followd eg. this post.
public class Main extends Application {
@Override
public void init() {
Font font =…

klenium
- 2,468
- 2
- 24
- 47
2
votes
1 answer
JavaFX apply rotate to an image from CSS
I'm wondering if there is a way to apply some transformations (i.e. rotate) to an image setted to some button. I am using css to specify all images by such way:
.custom-button {
-fx-graphic: url("imgs/buttons/button.png");
…

rvit34
- 1,967
- 3
- 17
- 33
2
votes
2 answers
Could not resolve '-fx-tab-border-color' while resolving lookups for '-fx-background-color' from rule in stylesheet
Since my rules are already in place but getting these errors flowlessly. I was trying to understand the solutions available on the web, but none of them worked for me.
Jul 18, 2016 1:39:17 PM javafx.scene.CssStyleHelper calculateValue WARNING:…

RAM World
- 97
- 3
- 8
2
votes
1 answer
Set border around imageview with no background in javafx
I would like to have a button or a clickable ImageView in my program. When clicked i would like to have a border to appear in a shape of the imageview. This image had no background, but i can't find a way to specify the border's shape. For…

Squittron
- 23
- 1
- 4
2
votes
1 answer
JavaFX CSS theming via @import and variables
I have taken to assigning variables to frequently-used colors in my JavaFX CSS and referencing the variables rather than the color constants:
* {
theme-backgroundDark: #335588;
}
#messageListPane {
-fx-background-color:…

josh2112
- 829
- 6
- 22
1
vote
0 answers
JavaFX css, loaded from a fxml file, doesn't seem to be loading an image
So, I am making a project where I need to add a background image to an anchor panel, and I am trying to be clean and use a separate css.
So far my project structure looks like this:
D:.
├───.idea
│ └───libraries
├───.mvn
│ └───wrapper
├───src
│ …

Gabe Lily
- 11
- 3
1
vote
0 answers
Customize ControlsFX Notification Popup using CSS
I am using the ControlsFX Notifications class to create a notification popup. Everything about it is great, except for the fact that I can't style it with CSS. From the research that I did, it says you must add a Notifications.owner(), and the…

JMisley
- 11
- 2
1
vote
1 answer
JavaFX TabPane remove border between Tabs and content
I want to remove the tiny border between the Tabs in a TabPane and their content. This border is part of the headers-region, and I've put its background in green in the images below. My application (code below) looks like this:
with the tabs having…

Sam Hooper
- 187
- 8
1
vote
1 answer
How to separate a border and an effect?
Currently, I have a button with the following CSS:
Button {
-fx-text-fill: -fx-color-text;
-fx-font: 15pt "Raleway SemiBold";
-fx-background-color: -fx-color-theme;
-fx-background-insets: 0, 0, 0, 0, 0, 1, 2;
…

FireController1847
- 1,458
- 1
- 11
- 26