New version is available You are viewing the documentation for JxBrowser 6 which is not supported since December 2019. Go to the current documentation.
List icon Contents

This short guide shows how to change your application code written with JxBrowser v6.2 to work with v6.3.

KeyEventsHandler in BrowserView

v6.3 makes it easier to handle keyboard events under both Swing and JavaFX.

In v6.2 two parameters were required:

view.setKeyEventsHandler(KeyEventsHandler.KeyEventType.ANY, new KeyEventsHandler<KeyEvent>() {
    public boolean handle(KeyEvent event) {
        // Suppress Ctrl+A
        return event.isControlDown() && event.getKeyCode() == KeyEvent.VK_A;
    }
});

In v6.3, it is only the InputEventsHandler:

view.setKeyEventsHandler(new InputEventsHandler<KeyEvent>() {
    public boolean handle(KeyEvent event) {
        return event.isControlDown() && event.getKeyCode() == KeyEvent.VK_A;
    }
});