Note: Advice in this article will only work for JxBrowser 6. See the corresponding article for JxBrowser 7 here.(注意:本文中的建议仅适用于JxBrowser6,JxBrowser7相应文章请点击这里。)


By default spell checker is enable and configured to use English (en-US) language. Chromium engine checks text in all text fields and text areas on the loaded web page and highlights all misspelled words.(默认情况下,拼写检查器处于启用状态,并配置为使用英语(en-US)语言。 Chromium引擎会检查已加载网页上所有文本字段和文本区域中的文本,并突出显示所有拼写错误的单词。)


JxBrowser provides API that allows enabling/disabling spell checker and configuring it to use specified language. The following code demonstrates how to enable spell checker functionality and configure it to use German (Standard) language (de): (JxBrowser提供的API允许启用/禁用拼写检查器并将其配置为使用指定的语言。以下代码演示了如何启用拼写检查器功能并将其配置为使用德语(标准)语言(de):)

Browser browser = new Browser();
SpellCheckerService spellChecker = browser.getContext().getSpellCheckerService();
spellChecker.setEnabled(true);
spellChecker.setLanguage("de");


Dictionaries(辞典)

Chromium supports both custom dictionary and dictionaries for different languages. It downloads required dictionary for the current language automatically. You can also add words to your custom dictionary which is stored in Chromium user's profile directory.(Chromium支持不同语言的自定义词典和字典。它会自动下载当前语言所需的词典。您还可以将单词添加到自定义词典中,该词典存储在Chromium用户的个人资料目录中。)