JDK-4032466 : item events not generated when state programmaticaly set on Checkbox/List
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5.1,solaris_10,windows_95
  • CPU: generic,x86,sparc
  • Submitted: 1997-02-14
  • Updated: 2000-03-08
  • Resolved: 2000-03-08
Related Reports
Duplicate :  
Duplicate :  
Description
Item events are not properly generated when the state of a Checkbox or List is
changed programmatically.


###@###.### 1999-07-06

I have to come up with this again, as we (Compatibility Kits team) cannot have
bug ids closed as not a bug on the exclude list.

Could someone explain why this is not a bug? JDC docs state:
'When an item is selected or deselected, AWT sends an instance of 
ItemEvent to the list' JCK tests expect ItemEvents to be generated, 
and they fail.

I'm reopening this bug with hope that someone will address this.

----------------------------------------------------------------------

By doing a setState() there's no ItemEvent generated.  Is this the intent
of the design?  If so the doc will have to be change to explicitly state
this behavior.

Roger Pham 3/7/2000

Comments
PUBLIC COMMENTS Item events are not properly generated when the state of a Checkbox or List is changed programmatically.
10-06-2004

EVALUATION Name: rrT76497 Date: 05/21/98 reproducible - Win95, WinNT, Solaris 2.5/Intel, Solaris2.6/SPARC On Win95/WinNT Bug Reproducible Tested with JDK1.1.5, JDK1.2beta3-N On Solaris 2.5/Intel, Solaris 2.6/SPARC Bug Reproducible Tested with JDK1.1.6N, JDK1.2beta3-N /** * @test * @bug<4032466> * @summary item events not generated when state programmaticaly set on Checkbox/List */ import java.awt.*; import java.awt.event.*; class CheckboxListTest extends Frame implements ActionListener, ItemListener { List list = new List(); Checkbox cb = new Checkbox("Checkbox Test"); Button button = new Button("OK"); CheckboxListTest() { super("Demo"); setSize(300,200); setLayout(new BorderLayout()); add("Center",list); add("South",button); add("North", cb); list.addItem("First"); list.addItem("Second"); list.addItem("Third"); setVisible(true); button.addActionListener(this); cb.addItemListener(this); list.addItemListener(this); } public static void main(String[] args) { new CheckboxListTest(); } public void actionPerformed(ActionEvent e) { if(e.getSource() == button) { list.select(1); cb.setState(true); } } public void itemStateChanged(ItemEvent e) { System.out.println("Item State Changed"); } } ====================================================================== Name: ksT78225 Date: 03/03/99 Itemevents do not generate when CheckBox's state is set programmaticaly. ====================================================================== Tested the report under Sun4 Solaris 2.7 and WinNT 4.0 SP5 with JDK 1.3RA The bug was not reproducible under Solaris where as the bug was reproducible under WinNT. sandeep.konchady@Eng 1999-11-29
29-11-1999

SUGGESTED FIX This (allong with 4024027 and 4090710) are fixed in java-solaris javasoft tree by the deltas: src/solaris/sun/awt_List.c - sid 1.34 src/solaris/sun/sun/awt/motif/MListPeer.java - sid 1.26 andy.herrick@East 1998-03-05
05-03-1998