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

By default, zoom functionality is enabled in JxBrowser. You can zoom the web page using the Browser.zoomIn(), Browser.zoomOut(), Browser.zoomReset(), Browser.setZoomLevel() methods or using touch gestures in the environment with touch screen. If you would like to disable zoom for specific Browser instance and don't let the end user to zoom the web page loaded in this Browser instance, then you can use the Browser.setZoomEnabled() method.

For example:

import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.swing.BrowserView;

import javax.swing.*;
import java.awt.*;

public class ZoomSample {
    public static void main(String[] args) {
        Browser browser = new Browser();
        BrowserView view = new BrowserView(browser);

        JFrame frame = new JFrame();
        frame.add(view, BorderLayout.CENTER);
        frame.setSize(700, 500);

        // Disabling zoom for the browser instance.


Once you call the browser.setZoomEnabled(false) method in the example above, the Chromium engine will ignore all attempts to change zoom level programmatically via JxBrowser Zoom API and using touch gestures on a touch screen device. If zoom level of the loaded the web page has been already changed, the Browser.setZoomEnabled(false) function call will reset zoom to 100% and disable zoom functionality.