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

When a text field or text area on the loaded web page receives focus, Chromium’s spell checker functionality automatically checks the text and highlights misspelled words. Using the SpellCheckListener you can obtain the information about misspelled words as well.

The following example demonstrates how to get notifications about spell check results:

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

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

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

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

        SpellCheckerService spellCheckerService =
        spellCheckerService.addSpellCheckListener(new SpellCheckListener() {
            public void onSpellCheckCompleted(SpellCheckCompletedParams params) {
                String text = params.getText();
                List<SpellCheckResult> checkResults = params.getResults();
                for (SpellCheckResult checkResult : checkResults) {
                    int errorStartIndex = checkResult.getStartIndex();
                    int errorLength = checkResult.getLength();

        browser.loadHTML("<html><body><textarea rows='20' cols='30'>" +
                "Smple text with mitake.</textarea></body></html>");