G
Gerald Rosenberg
I have extended HTMLEditorKit to override DeletePrevCharAction. The new
action is added to the ActionMap of a JTextPane.
The problem is that, in response to a backspace key (physical) press, my
custom DeletePrevCharAction.actionPerformed(evt) method is called
*twice* in rapid succession if my code is executed using JDK 1.4.2.
Running the exact same code under JDK 1.5 obtains the correct/desired
behavior: the actionPerformed method is called only once per key press.
Is this a known problem or is there something additional/special that
needs to be done to replace the backspace action in 1.4.2?
Googling suggests that there were known backspace key handling problems
as between JDK 1.3 and 1.4 -- registering a new backspace key action had
to handle both pressed and typed events in 1.3, but nothing as between
1.4.x and 1.5.
What do I need to do to ensure that backspaces are handled consistently
under both 1.4.2 and 1.5?
Thanks
action is added to the ActionMap of a JTextPane.
The problem is that, in response to a backspace key (physical) press, my
custom DeletePrevCharAction.actionPerformed(evt) method is called
*twice* in rapid succession if my code is executed using JDK 1.4.2.
Running the exact same code under JDK 1.5 obtains the correct/desired
behavior: the actionPerformed method is called only once per key press.
Is this a known problem or is there something additional/special that
needs to be done to replace the backspace action in 1.4.2?
Googling suggests that there were known backspace key handling problems
as between JDK 1.3 and 1.4 -- registering a new backspace key action had
to handle both pressed and typed events in 1.3, but nothing as between
1.4.x and 1.5.
What do I need to do to ensure that backspaces are handled consistently
under both 1.4.2 and 1.5?
Thanks