Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After stage.getIcons().add(new Image(is)) call the Alert and other Dialogs do not hiding after close #192

Open
bekasov opened this issue Dec 4, 2024 · 2 comments

Comments

@bekasov
Copy link

bekasov commented Dec 4, 2024

Hello!

OS: 6.11.10-2-MANJARO x64
JPRO: 2024.4.1

If I run the following code at the Stage's start

            String path = String.format("/icons/logotype_%d.png", size);
            try (InputStream is = App.class.getResourceAsStream(path)) {
                stage.getIcons().add(new Image(is));
            } catch (IOException e) {
                System.out.println(e.getMessage());
            }

then the icon is appearing at the site, but all the FX's dialogs and alerts cannot close, and at one case there is the following error:

image

without the icon all is OK

@FlorianKirmaier
Copy link
Contributor

@bekasov
Thank you for the bug report.

I was able to reproduce the exception.
It seems to happen when a stage is hidden/shown by code.

Regarding dialogs.
You probably create somewhere a "hidden monad dialog" somewhere.
If a window is Application Modal, it blocks input to all other windows.
If you don't set an owner, it's not visible by default.

@FlorianKirmaier
Copy link
Contributor

Minimal reproducable sample:

public class HelloJPro extends Application {

    public void start(Stage stage) {

        //String path = String.format("/on", size);
        try (InputStream is = HelloJPro.class.getResourceAsStream("/one/jpro/test/threed/texture_building.png")) {
            stage.getIcons().add(new Image(is));
        } catch (IOException e) {
            System.out.println(e.getMessage());
        }

        var testField = new TextField();

        var vbox = new VBox(testField);

        var scene = new Scene(vbox);
        stage.setScene(scene);
        stage.show();

        Platform.runLater(() -> {
            try {
                Thread.sleep(3000);
                Platform.runLater(() -> {
                    stage.hide();
                });

                Thread.sleep(1000);
                Platform.runLater(() -> {
                    stage.show();
                });
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });

    }
}
    ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants