I would like to create a Pane with 2 rounded corners top-left and top-right, how can i do this in javafx? I know that u can use "border-top-left-radius" in normal css but it wont work under javafx. Until now I tried:
.calendar {
-fx-border-top-left-radius: 10px;
-fx-border-top-right-radius: 10px;
}
Thanks in advance,
Zombie
JavaFX - 2D Shapes Rounded Rectangle By default, JavaFX creates a rectangle with sharp edges unless you set the height and width of the arc to +ve values (0<) using their respective setter methods setArcHeight() and setArcWidth().
The border-radius property defines the radius of the element's corners. Tip: This property allows you to add rounded corners to elements!
CSS3 Rounded corners are used to add special colored corner to body or text by using the border-radius property.A simple syntax of rounded corners is as follows − #rcorners7 { border-radius: 60px/15px; background: #FF0000; padding: 20px; width: 200px; height: 150px; }
.calendar{
-fx-border-radius: 10 10 0 0;
-fx-background-radius: 10 10 0 0;
/* top-left, top-right, bottom-right, and bottom-left corners, in that order. */
}
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