DingDongDang132
DingDongDang132

Reputation: 67

JavaFx customize button's look

I uploaded an image to my button, but it looks like this: enter image description here

The button isn't shaped like the image, and the button colors are still visible on the edges. Is there a way to change this?

Upvotes: 0

Views: 1334

Answers (2)

Omid
Omid

Reputation: 6103

Use:

button.setPadding(Insets.EMPTY);

Upvotes: 1

user7291698
user7291698

Reputation: 1990

try this:

button.setStyle("-fx-background-radius: 0; -fx-padding: 0; -fx-background-color: transparent;");

you can also apply the style in a css

Upvotes: 0

Related Questions