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

CodeArea seems to intercept the input method, preventing it from being passed to other TextFields. #1218

Open
impactCn opened this issue Feb 26, 2024 · 0 comments

Comments

@impactCn
Copy link
Contributor

demo

public class Undefined extends Application {


    @Override
    public void start(Stage primaryStage) throws Exception {
        CodeArea codeArea = new CodeArea();
        Button button = new Button("Button");
        TextField textField = new TextField();
        button.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                Popup popup = new Popup();
                popup.getContent().add(textField);
                popup.show(primaryStage);
            }
        });
        textField.setOnKeyPressed(new EventHandler<KeyEvent>() {
            @Override
            public void handle(KeyEvent keyEvent) {
                // debug
                System.err.println(keyEvent.getCode());
            }
        });
        VBox vBox = new VBox();
        vBox.getChildren().addAll(codeArea, button);
        Scene scene = new Scene(vBox, 600, 400);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

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

test
1

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

1 participant