posted 16 years ago
I have an action listener attached to a NumericTextField (extends JTextField).
I display 3 of these then enter 0 which is detected by the listener.
No problems so far.
The first time the listener is fired 1 time.
the 2nd time the listener is fired 2 times.
the 3rd time the listener is fired 4 times.
What is causing the repetitions and how do I prevent it.
AM I right in thinking it has something to with using a Timer?
Thanks,
Gary.
output is :-
java.awt.event.ActionEvent[ACTION_PERFORMED,cmd=0,when=1200452253421,modifiers=] on AA AA
deleted true
java.awt.event.ActionEvent[ACTION_PERFORMED,cmd=0,when=1200452265827,modifiers=] on BB BB
deleted true
java.awt.event.ActionEvent[ACTION_PERFORMED,cmd=0,when=1200452265827,modifiers=] on BB BB
deleted false
java.awt.event.ActionEvent[ACTION_PERFORMED,cmd=0,when=1200452270327,modifiers=] on CC CC
deleted true
java.awt.event.ActionEvent[ACTION_PERFORMED,cmd=0,when=1200452270327,modifiers=] on CC CC
deleted false
java.awt.event.ActionEvent[ACTION_PERFORMED,cmd=0,when=1200452270327,modifiers=] on CC CC
deleted false
java.awt.event.ActionEvent[ACTION_PERFORMED,cmd=0,when=1200452270327,modifiers=] on CC CC
deleted false