Search code examples
javajxbrowser

Unable to find replacement for `DisposeListener` class


Upgrading to 7.21.2 from 6.20. Having trouble finding a callback that replaces the com.teamdev.jxbrowser.chromium.events.DisposeListener class.


Solution

  • There is a BrowserClosed event to track when a particular browser is closed:

    browser.on(BrowserClosed.class, event -> { System.out.println("Bye") });
    

    And EngineClosed to detect when the whole engine has been closed:

    engine.on(EngineClosed.class, event -> {});