Questions tagged [javafx-css]

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.

Useful resources

141 questions
0
votes
2 answers

Why aren't my CSS borders showing up in JavaFX gui?

I'm trying to show walls on the GUI (fxml) with CSS borders using .getStyleClass().add() but they're not showing up. I'm using a switch that adds the corresponding style classes to the cells. The Java code: private StackPane createCell(int row, int…
0
votes
0 answers

JavaFX button hover underline animation like in css

Can you give me tips to create this animation in JavaFX? animation Or underline may move from left to right My current .css file .button{ -fx-background-color: rgba(0,0,0,0.1); -fx-shape: "M 400 200 L 400 250 L 500 250 L 500 200 L 400…
zawww
  • 1
  • 1
0
votes
0 answers

JavaFX Make WebEngine setUserStyleSheetLocation detect CSS file in a JAR

I'm trying to style a JavaFX WebEngine using the setUserStyleSheetLocation method. The method's documentation says it requires a "local URL" starting with data:, file:, jar:, or jrt:. I want to package my project in a runnable JAR file, but I don't…
Sam Hooper
  • 187
  • 8
0
votes
1 answer

Can you dynamically apply a colour scheme to a single css file?

I have 4 different css files that are identical except they use different colour schemes i.e. red, blue, green. At the start of my program a user chooses which colour scheme they want and then the corresponding css file is chosen. Is there a way to…
user16251398
0
votes
1 answer

What's the difference between -fx-text-fill and -fx-text-inner-color in JavaFX CSS?

From the JavaFX CSS Reference Guide I know enough about the -fx-text-fill property to use it. Working on a larger JavaFX project that has recently been updated to JavaFX 16, I came across some CSS code that uses -fx-text-inner-color to apparently…
Chaoskatze
  • 41
  • 9
0
votes
2 answers

Add css style to ButtonType in JavaFX

I have an alert. I'm adding two ButtonTypes to it. I'm also adding a stylesheet to it. But how can I make the Discard changes red? I have already a btn-red class in my CSS file. Alert alert = new Alert(AlertType.CONFIRMATION); //setting up content…
SDG6
  • 91
  • 1
  • 8
0
votes
1 answer

How can I apply a drop shadow to the bottom of a table row on hover

This is giving me only a drop shadow on top. Increasing the y-offset does nothing. It looks like it might be "behind something" .table-row-cell:hover { -fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.3), 10, 0.5, 0.0, 0.0) } //increased y axis…
jpell
  • 198
  • 2
  • 10
0
votes
2 answers

How to remove a line of shadow under javafx button

Using JavaFX 15 There's a line of shadow below the border of the JavaFX FXML button. is it possible to make it transparent using CSS? As I do not know which attribute it belongs to. Picture of the button attached below .btn{ …
Teo Shi Bin
  • 5
  • 1
  • 2
0
votes
0 answers

JavaFX CSS how do I blend Text color to appear as white when a progress bar overlaps it?

I have this image of a progress bar: I am trying to make the text change color as the bar overlaps it. I have no idea how to do this in JavaFX since it is not as flexible as the known CSS. I tried to use different blend modes provided but no use I…
0
votes
0 answers

Styling DatePicker ArrowButton in Javafx

How to achieve the following style for Datepicker Arrow Button? I am able to Achieve the following Style For Arrow Button. Below Css is used for achieving the above style .date-picker > .arrow-button > .arrow { -fx-opacity:0; } .date-picker >…
Viraj Shedge
  • 1
  • 2
  • 4
0
votes
1 answer

How to remove blue focus border from TableView?

I'm styling a TableView. I set the border color to white (same as background color) so it is invisible. However, when the table is focused, the border becomes blue. I tried adding table-view:focused { -fx-border-color: white; } to fix it, but it…
Allan Juan
  • 2,048
  • 1
  • 18
  • 42
0
votes
1 answer

Styling JFoenix Tabpane

I am using JFoneix Library for creating a tabpane in javafx. Everything works fine however i am unable to remove the extended line connecting the tabs. How can i achieve that? Below Css has been used to design the tabpane #testDatesTab…
Viraj Shedge
  • 1
  • 2
  • 4
0
votes
1 answer

Cannot add CSS classes to my JavaFX Label

I am making a simple todolist app. Here is a watered-down version of it: public class Main extends Application { @Override public void start(Stage primaryStage) throws Exception{ ListView
0
votes
0 answers

Cant find CSS style sheet in java fx

So this is the file structure im working with, I have the app.java as my main java file and I tried these two lines of code to no…
0
votes
1 answer

center align textarea in JavaFX with CSS

I know I am supposed to set -fx-text-alignment: center; in order to achieve a center-aligned textarea. #txtFaContent { -fx-text-alignment: center; } with txtFaContent being the ID of my textarea (as well as its variable name inside the…
Joseph_Marzbani
  • 1,796
  • 4
  • 22
  • 36