I've noticed that buttons in JavaFX have rounded corners, which means when you have a grid of them there are little white spaces visible between.
This illustrates the problem
I'd like to make my buttons appear as rectangles, with right angled corners, is this possible? I assume this might be possible with CSS, but I can't find this question being asked before.
Thanks.
You can do Via CSS :
"-fx-background-radius: 0"
You can add your CSS file in several ways by code , by Inline , External file
By Code :
Button rectangleButton = new Button();
roundButton.setStyle("-fx-background-radius: 0");
By FXML Inline :
By FXML External :
mystyle.css file
.button{
-fx-background-radius: 0;
}
then choose directory of file to apply the style to your container
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With