com.swabunga.spell.swing

Class JTextComponentSpellChecker

public class JTextComponentSpellChecker extends Object implements SpellCheckListener

This class spellchecks a JTextComponent throwing up a Dialog everytime it encounters a misspelled word.

Author: Robert Gustavsson (robert@lindesign.se)

Constructor Summary
JTextComponentSpellChecker(SpellDictionary dict)
JTextComponentSpellChecker(String dictFile)
JTextComponentSpellChecker(String dictFile, String title)
JTextComponentSpellChecker(String dictFile, String phoneticFile, String title)
JTextComponentSpellChecker(SpellDictionary dict, SpellDictionary userDict, String title)
Method Summary
voidsetUserDictionary(SpellDictionary dictionary)
Set user dictionary (used when a word is added)
intspellCheck(JTextComponent textComp)
This method is called to check the spelling of a JTextComponent.
voidspellingError(SpellCheckEvent event)
voidstartAutoSpellCheck(JEditorPane pane)
voidstopAutoSpellCheck(JEditorPane pane)

Constructor Detail

JTextComponentSpellChecker

public JTextComponentSpellChecker(SpellDictionary dict)

JTextComponentSpellChecker

public JTextComponentSpellChecker(String dictFile)

JTextComponentSpellChecker

public JTextComponentSpellChecker(String dictFile, String title)

JTextComponentSpellChecker

public JTextComponentSpellChecker(String dictFile, String phoneticFile, String title)

JTextComponentSpellChecker

public JTextComponentSpellChecker(SpellDictionary dict, SpellDictionary userDict, String title)

Method Detail

setUserDictionary

public void setUserDictionary(SpellDictionary dictionary)
Set user dictionary (used when a word is added)

spellCheck

public int spellCheck(JTextComponent textComp)
This method is called to check the spelling of a JTextComponent.

Parameters: textComp The JTextComponent to spellcheck.

Returns: Either SpellChecker.SPELLCHECK_OK, SpellChecker.SPELLCHECK_CANCEL or the number of errors found. The number of errors are those that are found BEFORE any corrections are made.

spellingError

public void spellingError(SpellCheckEvent event)

startAutoSpellCheck

public void startAutoSpellCheck(JEditorPane pane)

Parameters: pane

stopAutoSpellCheck

public void stopAutoSpellCheck(JEditorPane pane)

Parameters: pane