0

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{
    -fx-background-color: black;
    -fx-background-radius: 30px;
    -fx-border-color: white;
    -fx-border-radius: 30px;
    -fx-border-width: 3px;
}

colored with black background and white borderline for visibility

picture of the shadow line under the button

Slaw
  • 37,820
  • 8
  • 53
  • 80
Teo Shi Bin
  • 5
  • 1
  • 2

2 Answers2

0

I have never seen this behaviour, but a nice reference for attributes available to the basic JavaFX-classes can be found here: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html

This could maybe be due to not overwriting all the standard JavaFX button style attributes.

0

It is possible that what you are seeing is the background spilling out past the border. Since you have customized the border thickness in the CSS, you may also need to adjust background insets.

See the CSS docs for Region https://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#region

swpalmer
  • 3,890
  • 2
  • 23
  • 31