harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry A. Durnev (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1533) [classlib][swing] JCombobox.setSelectedItem() sometimes doesn't fire action event
Date Thu, 21 Sep 2006 16:02:23 GMT
[classlib][swing] JCombobox.setSelectedItem() sometimes doesn't fire action event
---------------------------------------------------------------------------------

                 Key: HARMONY-1533
                 URL: http://issues.apache.org/jira/browse/HARMONY-1533
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Dmitry A. Durnev
            Priority: Minor


Spec of JCombobox.setSelectedItem() says:

ActionListeners added to the combo box will be notified with an ActionEvent when this method
is called. 

But the following test prints "false" on Harmony & "true" on RI:

public class JComboboxTest {
    private static boolean fired;

   public class JComboboxTest {
    private static boolean fired;

    public static void main(String[] args) {
        String item = "item";
        JComboBox jcb = new JComboBox(new String[]{item});
        jcb.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent ae) {
                fired = true;               
            }            
        });
        jcb.setSelectedItem(item);
        System.out.println(fired);

    }
}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message