Reputation: 41
Its too easy to make all corner round by using archWidth()
and archHeight()
.
But I need only top-left, top-right and left-bottom corner round.
I need to display image where image have top-left, top-right and left-bottom rounded corner. please help me ........
Upvotes: 2
Views: 4312
Reputation: 1173
If you use a Region, you can set the backgroud radii in CSS:
public class FXRadiusTest extends Application
{
@Override
public void start(Stage stage)
{
Region rect = new Region();
rect.setPrefSize(200, 200);
rect.setStyle("-fx-background-color: red; -fx-background-radius: 10 10 0 10");
stage.setScene(new Scene(new Group(rect), 400, 400));
stage.show();
}
public static void main(String... args)
{
Application.launch(FXRadiusTest.class, args);
}
}
Upvotes: 5
Reputation: 5897
Use a Region instead it allows to define background-radius values for each corner
Upvotes: 1