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

The user-agent string can be modified only once, before you create any Browser instances. You can provide your own user-agent string using the BrowserPreferences.setUserAgent(String userAgent) method or via the jxbrowser.chromium.user-agent Java System Property: 

BrowserPreferences.setUserAgent("My User Agent String");

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

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

 * The sample demonstrates how to configure user-agent string
 * for all Browser instances.
public class UserAgentSample {
    public static void main(String[] args) {
        // It's very important to configure user-agent string
        // before any Browser instance is created.
        BrowserPreferences.setUserAgent("My User Agent String");

        Browser browser = new Browser();
        BrowserView browserView = new BrowserView(browser);

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