JDK-6181163 : REGRESSION: Disabled textfield responds to keyevents visually on win32
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-10-19
  • Updated: 2007-10-16
  • Resolved: 2005-10-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
I have a frame with a button and textfield. When I click the button, I disable both button as well as textfield. But due to forward focus transfer, the disabled text field gains focus. Once it gains focus, I am able to type any text in the textfield and pressing 'ENTER' triggers action event for the text field. But surprisingly, no keyevents are dispatched to the textfield. Disabled components should not respond to any of the keyevents, both visually as well as events wise. 

This looks pretty ugly where the text is shown in gray color to denote that it is disabled but the user is still able to type anything in the text field. A similar bug was filed against button sometime back and it is fixed for the button (5044469) in the current mustang PIT build (b08). 

This is reproducible only on Win32 since 1.4.2. Not reproducible on earlier releases. Hence this is a regression in 1.4.2.

I have attached a sample test. Execute the sample test. Click on the 'disable' button. Focus will be shifted to the disabled text field. Try typing some text in the text field. If the text field shows the typed characters, the bug is reproduced.
###@###.### 10/19/04 13:26 GMT

This is reproducible with Choice and List components as well. Moving the arrow keys on a disabled choice / list changes the item selection.
###@###.### 10/19/04 17:44 GMT

Comments
EVALUATION awt_Toolkit.cpp.PreProcessKeyEvent should use more common condition then in 5044469 where the fix affected Buttons only. ###@###.### 10/21/04 09:34 GMT With 5044469 fix backed out, we should find a more generic, platform-independent way to cut off key events to disabled components. ###@###.### 2005-07-06 13:02:58 GMT
21-10-2004