Custom JavaFX button shapes


Question

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

1
3
12/9/2013 6:22:44 PM

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.

2
11/20/2014 11:54:32 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon