Class JTextComponentSpellChecker

java.lang.Object
com.swabunga.spell.swing.JTextComponentSpellChecker
All Implemented Interfaces:
SpellCheckListener, EventListener

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 Details

  • Method Details

    • 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.
    • startAutoSpellCheck

      public void startAutoSpellCheck(JEditorPane pane)
      Parameters:
      pane -
    • stopAutoSpellCheck

      public void stopAutoSpellCheck(JEditorPane pane)
      Parameters:
      pane -
    • spellingError

      public void spellingError(SpellCheckEvent event)
      Description copied from interface: SpellCheckListener
      Propagates the spelling errors to listeners.
      Specified by:
      spellingError in interface SpellCheckListener
      Parameters:
      event - The event to handle