Created
February 24, 2009 19:17
-
-
Save keithrbennett/69732 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.event.DocumentEvent; | |
import javax.swing.event.DocumentListener; | |
/** | |
* Simplifies the DocumentListener interface by having all three | |
* interface methods delegate to a single method. | |
* | |
* To use this abstract class, subclass it and implement the abstract | |
* method handleDocumentEvent(). | |
*/ | |
public abstract class SimpleDocumentListener implements DocumentListener { | |
/** | |
* Implement this method when subclassing this class. | |
* It will be called whenever a DocumentEvent occurs. | |
*/ | |
abstract public void handleDocumentEvent(DocumentEvent event); | |
public void changedUpdate(DocumentEvent event) { | |
handleDocumentEvent(event); | |
} | |
public void insertUpdate(DocumentEvent event) { | |
handleDocumentEvent(event); | |
} | |
public void removeUpdate(DocumentEvent event) { | |
handleDocumentEvent(event); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment