RichTextFX icon indicating copy to clipboard operation
RichTextFX copied to clipboard

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

Open impactCn opened this issue 11 months ago • 0 comments

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

impactCn avatar Feb 26 '24 13:02 impactCn