Package com.swabunga.spell.swing
Class JTextComponentSpellChecker
java.lang.Object
com.swabunga.spell.swing.JTextComponentSpellChecker
- All Implemented Interfaces:
SpellCheckListener
,EventListener
This class spellchecks a JTextComponent throwing up a Dialog everytime
it encounters a misspelled word.
- Author:
- Robert Gustavsson (robert@lindesign.se)
-
Constructor Summary
ConstructorsConstructorDescriptionJTextComponentSpellChecker
(SpellDictionary dict, SpellDictionary userDict, String title) JTextComponentSpellChecker
(String dictFile) JTextComponentSpellChecker
(String dictFile, String title) JTextComponentSpellChecker
(String dictFile, String phoneticFile, String title) -
Method Summary
Modifier and TypeMethodDescriptionvoid
setUserDictionary
(SpellDictionary dictionary) Set user dictionary (used when a word is added)int
spellCheck
(JTextComponent textComp) This method is called to check the spelling of a JTextComponent.void
spellingError
(SpellCheckEvent event) Propagates the spelling errors to listeners.void
void
-
Constructor Details
-
JTextComponentSpellChecker
-
JTextComponentSpellChecker
- Throws:
IOException
-
JTextComponentSpellChecker
- Throws:
IOException
-
JTextComponentSpellChecker
public JTextComponentSpellChecker(String dictFile, String phoneticFile, String title) throws IOException - Throws:
IOException
-
JTextComponentSpellChecker
-
-
Method Details
-
setUserDictionary
Set user dictionary (used when a word is added) -
spellCheck
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.
-
startAutoSpellCheck
- Parameters:
pane
-
-
stopAutoSpellCheck
- Parameters:
pane
-
-
spellingError
Description copied from interface:SpellCheckListener
Propagates the spelling errors to listeners.- Specified by:
spellingError
in interfaceSpellCheckListener
- Parameters:
event
- The event to handle
-