Skartt
Skartt

Reputation: 591

Round corner of popup window: blank corners

I tried to execute the code provided in this post: How to Round the Corners of a JavaFX PopupControl

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.PopupControl;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class Main extends Application {

    @Override
    public void start(Stage stage) {
        PopupControl pu = new PopupControl();

        VBox vb = new VBox();
        vb.setPrefWidth(300);
        vb.setPrefHeight(200);
        vb.setStyle("-fx-background-color: rgba(17, 230, 120, 1.0); " +
                    "-fx-background-radius: 10;");

        Scene scene = new Scene(vb);
        pu.setScene(scene);

        stage.setWidth(600);
        stage.setHeight(500);
        stage.show();

        pu.show(stage);
    }

    public static void main(String[] args) {
        launch(args);
    }
}

I didn't have the expected result, I have blank corners on my popup, like in this image: enter image description here

How to remove them and have a real rounded corner without white in the corner ?

Edit:

Upvotes: 2

Views: 65

Answers (0)

Related Questions