Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: JFormattedTextField backspace issue in 6u20 + 5u24
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JFormattedTextField backspace issue in 6u20 + 5u24



Thank you for the bug - this is a very serious issue we'll look into right away. It appears that the deletePrevCharAction is somehow being added twice to the component.

Thanks much,
Mike Swingler
Java Runtime Engineer
Apple Inc.

On May 21, 2010, at 9:17 AM, Jim Douglas wrote:

Reported as:

Problem ID: 8013559
1.6.0_20: JFormattedTextField backspace deletes two characters for each keypress

Summary: JFormattedTextField backspace deletes two characters for each keypress. Steps to Reproduce: Run any sample containing a JFormattedTextField; press backspace. For example, pick one of the Sun samples from here: http://java.sun.com/docs/books/tutorial/uiswing/components/formattedtextfield.html Expected Results: Backspace should delete either the current selection, or the single character before the cursor. Actual Results: DefaultEditorKit.deletePrevCharAction is apparently being invoked twice for a single keypress. Regression: This issue was introduced in: * Java for Mac OS X 10.5 Update 7 (1.6.0_20 + 1.5.0_24) * Java for Mac OS X 10.6 Update 2 (1.6.0_20) Notes: http://lists.apple.com/archives/java-dev/2010/May/msg00082.html

On May 21, 2010, at 8:49 AM, Jim Douglas wrote:

FWIW, it looks like deletePrevCharAction is being invoked twice for each backspace keypress.

The attached program merges in the code for DefaultEditorKit.deletePrevCharAction, with some added debug.  If you press the delete key from the end of the first field, you can see it invoking this action twice.  If you run it on Windows, the action is only invoked once.

$ java FormattedTextFieldDemo
java.lang.Exception: deletePrevCharAction
at FormattedTextFieldDemo$1.actionPerformed(FormattedTextFieldDemo.java:69)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1573)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2766)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2801)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2729)
at java.awt.Component.processEvent(Component.java:5379)
at java.awt.Container.processEvent(Container.java:2010)
at java.awt.Component.dispatchEventImpl(Component.java:4068)
at java.awt.Container.dispatchEventImpl(Container.java:2068)
at java.awt.Component.dispatchEvent(Component.java:3903)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1828)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:681)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:940)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:810)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:645)
at java.awt.Component.dispatchEventImpl(Component.java:3941)
at java.awt.Container.dispatchEventImpl(Container.java:2068)
at java.awt.Window.dispatchEventImpl(Window.java:1801)
at java.awt.Component.dispatchEvent(Component.java:3903)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Remove character from: 6,1
java.lang.Exception: deletePrevCharAction
at FormattedTextFieldDemo$1.actionPerformed(FormattedTextFieldDemo.java:69)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1573)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2766)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2801)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2729)
at java.awt.Component.processEvent(Component.java:5379)
at java.awt.Container.processEvent(Container.java:2010)
at java.awt.Component.dispatchEventImpl(Component.java:4068)
at java.awt.Container.dispatchEventImpl(Container.java:2068)
at java.awt.Component.dispatchEvent(Component.java:3903)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1828)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:681)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:940)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:810)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:645)
at java.awt.Component.dispatchEventImpl(Component.java:3941)
at java.awt.Container.dispatchEventImpl(Container.java:2068)
at java.awt.Window.dispatchEventImpl(Window.java:1801)
at java.awt.Component.dispatchEvent(Component.java:3903)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Remove character from: 5,1


<FormattedTextFieldDemo.java>

On May 21, 2010, at 7:26 AM, Jim Douglas wrote:

I'm using Leopard, so I'm not sure if this also applies to Snow Leopard.

Run any of the JFormattedTextField demos here (web start is fine):

http://java.sun.com/docs/books/tutorial/uiswing/components/formattedtextfield.html

The backspace key is now deleting two characters at a time.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >JFormattedTextField backspace issue in 6u20 + 5u24 (From: Jim Douglas <email@hidden>)
 >Re: JFormattedTextField backspace issue in 6u20 + 5u24 (From: Jim Douglas <email@hidden>)
 >Re: JFormattedTextField backspace issue in 6u20 + 5u24 (From: Jim Douglas <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.