SwingNode black content ... still a problem

adam at adamish.com adam at adamish.com
Fri Mar 3 11:16:51 UTC 2017


https://bugs.openjdk.java.net/browse/JDK-8097328 is marked as
resolved...

However, using jdk-8u121-windows-i586 on Windows 7 I still see the
same issue. Black content in Swing Node until repaint is forced, for
example by dragging the window off-screen and on-screen again...
I also saw same issue with 8u40

The simplest case I come up with for this:

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

    @Override
    public void start(Stage primaryStage) throws Exception {
        SwingNode swingNode = new SwingNode();
        SwingUtilities.invokeAndWait(() -> {
            swingNode.setContent(createSwingContent());
        });
        VBox vBox = new VBox(new Label("Fx content"), new
HBox(swingNode));
        primaryStage.setScene(new Scene(vBox));
        primaryStage.setWidth(300);
        primaryStage.setHeight(300);
        primaryStage.show();
    }

    private JComponent createSwingContent() {
        JPanel panel = new JPanel();
        panel.add(new JLabel("Swing content"));
        return panel;
    }




More information about the openjfx-dev mailing list