From commits-return-43274-apmail-harmony-commits-archive=harmony.apache.org@harmony.apache.org Wed Sep 05 13:39:54 2007 Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 44614 invoked from network); 5 Sep 2007 13:39:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Sep 2007 13:39:54 -0000 Received: (qmail 55348 invoked by uid 500); 5 Sep 2007 13:39:49 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 55262 invoked by uid 500); 5 Sep 2007 13:39:48 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 55253 invoked by uid 99); 5 Sep 2007 13:39:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2007 06:39:48 -0700 X-ASF-Spam-Status: No, hits=-99.6 required=10.0 tests=ALL_TRUSTED,SUBJECT_FUZZY_TION X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2007 13:39:53 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7F599714163 for ; Wed, 5 Sep 2007 06:39:33 -0700 (PDT) Message-ID: <13696823.1188999573510.JavaMail.root@brutus> Date: Wed, 5 Sep 2007 06:39:33 -0700 (PDT) From: "Alexei Zakharov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Resolved: (HARMONY-4658) [classlib][swing][compartibility] The order of ItemStateChanged events in buttonGroup is differs from RI In-Reply-To: <26950216.1187699010485.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-4658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexei Zakharov resolved HARMONY-4658. -------------------------------------- Resolution: Fixed This one is much better, thanks Dmitry. Applied at the revision 572950. Please verify. > [classlib][swing][compartibility] The order of ItemStateChanged events in buttonGroup is differs from RI > -------------------------------------------------------------------------------------------------------- > > Key: HARMONY-4658 > URL: https://issues.apache.org/jira/browse/HARMONY-4658 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Dmitry Irlyanov > Assignee: Alexei Zakharov > Attachments: H4658-DefaultButtonModel-JToggleButton.patch > > > The order of itemStateChanged events is different for RI and for our implementation. It isn't a bug because the behavior is unspecified, but some applications may rely on this issue > import java.awt.event.ItemEvent; > import java.awt.event.ItemListener; > import javax.swing.AbstractButton; > import javax.swing.ButtonGroup; > import javax.swing.JRadioButton; > public class Test { > public static void main(String[] args) { > ButtonGroup group = new ButtonGroup(); > JRadioButton b1 = new JRadioButton("First"); > JRadioButton b2 = new JRadioButton("Second"); > group.add(b1); > group.add(b2); > b1.setSelected(true); > ItemListener buttonListener = new ItemListener() { > public void itemStateChanged(ItemEvent e) { > AbstractButton rb = (AbstractButton) e.getSource(); > System.err.println(rb.getText() + " state changed"); > } > }; > b1.addItemListener(buttonListener); > b2.addItemListener(buttonListener); > b2.setSelected(true); > b1.setSelected(true); > b2.setSelected(true); > b1.setSelected(true); > } > } > Output: > RI: > First state changed > Second state changed > Second state changed > First state changed > First state changed > Second state changed > Second state changed > First state changed > Harmony: > Second state changed > First state changed > First state changed > Second state changed > Second state changed > First state changed > First state changed > Second state changed -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.