JDK-6348031 : Text Cursor blinks inside a disabled text field, Win32
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-11-09
  • Updated: 2011-04-28
Related Reports
Relates :  
Description
I have a button and a text field placed inside a frame. On Clicking the button, I am actually disabling the button as well as the text field. As per the specification, the button (focus owner) initiates a forward focus traversal when clicked and focus goes to the text field which is also disabled. 

On Win32, I am surprised to see the text cursor actually blinking inside the disabled text field. It looks as if the text field is responsive to user inputs, though in reality, it is not. So the blinking cursor must actually be removed. This is how it works for XAWT. On XAWT, no cursor is seen on a disabled text field. 

This is reproducible on WinXP since Mustang-b58. I could not regress it on earlier builds/releases since the text field was actually responding to user inputs because of another bug that got fixed in b58 (5044469). Not reproducible on XAWT.

I have attached a testcase. Execute the test. Click on the disable button. Focus will be shifted to disabled text field and you would actually see a text cursor blinking inside the text field.

Comments
EVALUATION This is native behavior. We should try fixing this by disabling cursor in a focused disabled control, maybe ES_READONLY will help but I'm not sure, we should look it up. Yes, and anyway it would be just a workaround to the flawed focus traversal mechanism. Probably we should never have focus in the disabled control. At least in the native-level sense.
11-11-2005

EVALUATION Windows specific. Reproducible from JDK1.4 and still with JDK6.0b58.
10-11-2005