Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom JavaFX button shapes

I'm not a veteran coder of JavaFX and would like to ask. How do you make or set a different shape to a button in JavaFX? Buttons in default have these rounded rectangular shapes to them. I would like to make a button shaped like the image below, an L-shape button.

I have googled this topic for many times but still got no luck in finding the solution.

Can you help me please?

Image

like image 499
Joross Barredo Avatar asked Dec 05 '25 14:12

Joross Barredo


1 Answers

There is a way to get rid of the gray background color. you can set it to tranparent then your button will be just the image. in your case it will be x.setStyle("-fx-background-color: transparent") x being your button.

like image 104
tiemby Avatar answered Dec 08 '25 17:12

tiemby



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!