W
Wizumwalt
MyDocumentListener implements the DocumentListener interface. The
problem I'm having with it is that when I start my GUI, the
insertUpdate() and removeUpdate() methods that I overrode are
constantly being called even though I don't type anything in the text
field that the listener is attached to. It's kinda causing havoc in
MyDocumentListener where I handle the input.
Supposedly these methods give notification that an insert or other
change happened in the document, but I didn't make any changes, yet
they're constantly being called.
Anyone know why this is or understand what's going on here. Any help
much appreciated.
problem I'm having with it is that when I start my GUI, the
insertUpdate() and removeUpdate() methods that I overrode are
constantly being called even though I don't type anything in the text
field that the listener is attached to. It's kinda causing havoc in
MyDocumentListener where I handle the input.
Code:
MyDocumentListener listener = new MyDocumentListener(...);
myTextField.getDocument().addDocumentListener(listener);
// ... interface methods in MyDocumentListener
public void insertUpdate(DocumentEvent de) {
// ...
}
public void changedUpdate(DocumentEvent de) {
// ...
}
public void removeUpdate(DocumentEvent de) {
// ...
}
Supposedly these methods give notification that an insert or other
change happened in the document, but I didn't make any changes, yet
they're constantly being called.
Anyone know why this is or understand what's going on here. Any help
much appreciated.