JDK-4034837 : Checkbox.setState() does not notify listeners
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5.1,windows_95
  • CPU: x86,sparc
  • Submitted: 1997-02-26
  • Updated: 1998-10-15
  • Resolved: 1998-10-15
Related Reports
Duplicate :  
Duplicate :  
Description
Name: mc57594			Date: 02/26/97

Your sun.awt.windows.WCheckBoxPeer seems to have a problem:

When you call the setState() function on the Checkbox, there
should be an ItemEvent() created, to notify anyone who is
watching the box.  For example, if a text field should only
be enabled if a checkbox is checked, and the checkbox is checked
by setState() instead of a mouse click, the text field should
still be enabled.  The only other option is to go back to
polling the CheckBox, or override setState().

This is just my opinion of what SHOULD happen, but it seems
clear that the delegation model is rendered much less useful
if things remain as they are.

======================================================================

Comments
EVALUATION mike.somlo@eng 1997-12-04: Need more info. The example, in the Description field, doesn't make sense. Please elaborate (clearly). You say that the text field should still be enabled. As opposed to what? [chamness 12/29/97] Cannot contact submitter of bug. Closing bug. ----- The following addresses had permanent fatal errors ----- <###@###.###> ----- Transcript of session follows ----- ... while talking to biz1.mailsrvcs.net.: >>> RCPT To:<###@###.###> <<< 550 Invalid recipient <###@###.###> 550 <###@###.###>... User unknown ken.arnold@East 1998-01-05 There were *two* submitters. I am one, and I clearly could be contacted. Please try harder next time. The point is that no event is generated when using setState() to modify the buttons state. The event is only generated by user gestures. This means that you cannot trigger actions off the change of the buttons state, only off the change of the button's state by the user clicking on it. To reproduce the bug, try the following: create a GUI with a checkbox set up a listener for the event that just says "hi" change the state using the mouse. You will see "hi" change the state using another button that invokes setState() on the checkbox. You will not (if the bug still exists) see "hi". Is that clear enough?
11-06-2004

SUGGESTED FIX fixed in java-solaris in: src/solaris/sun/awt_Checkbox.c - sid 1.20, and src/solaris/sun/sun/awt/motif/MCCheckboxPeer.java - sid 1.15 similar fix could made on windows platform.
11-06-2004

PUBLIC COMMENTS Cannot contact user for more information on bug.
10-06-2004