Note: Advice in this article will only work for JxBrowser 6. See the corresponding article for JxBrowser 7 here.


If you need to cancel or disable printing at all you can use the following approach:

browser.setPrintHandler(new PrintHandler() {
    @Override
    public PrintStatus onPrint(PrintJob printJob) {
        return PrintStatus.CANCEL;
    }
});