“The Alert.Show() method will cause the input box to become unresponsive on Android devices.”

  Kiến thức lập trình

Problem:

Whenever an Alert window pops up, it causes an issue where input becomes impossible.

Demo Video: Link

Minimal Reproduction: inputTest.zip

Creating a new Stage and then closing it, even if the focus returns to the initial Stage, the input components can gain focus and invoke the input method, but no input is possible. I suspect that the event loop is affected by the new Stage, causing the system to fail to handle the event loop correctly.

What I’ve Tried: Manually locking the focus to the input field after the alert closes:

 alert.setOnHidden(evt -> {
                Platform.runLater(() -> textField.requestFocus());
            });

Unfortunately, this still doesn’t work.

I’ve also tried searching for an open-source JavaFX cross-platform project online to find a solution, but all the projects I found use Gluon Glisten, which I don’t want to use.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT