bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-classpath] [bug #13691] Swing: 2 JCheckBox and 1 AbstractButton bug


From: Robert Schuster
Subject: [bug-classpath] [bug #13691] Swing: 2 JCheckBox and 1 AbstractButton bugs, fixes included
Date: Wed, 13 Jul 2005 01:06:56 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.8) Gecko/20050514

Update of bug #13691 (project classpath):

                Category:                    None => classpath              
                  Status:                    None => In Progress            
             Assigned to:                    None => rschuster              
             Open/Closed:                    Open => In Process             

    _______________________________________________________

Follow-up Comment #1:

Here is a test app I used to find out JDK's behavior (it is underspecified)
:(

public class Test {
        public static void main(String[] args) throws Exception {
                test(new JButton("bla"));
                test(new JRadioButton("bla"));
                test(new JToggleButton("bla"));
                test(new JCheckBox("bla"));
        }

        public static void test(AbstractButton jb) {
                System.out.println("class: " + jb.getClass());

                // use the label by default
                System.out.println(jb.getActionCommand());

                jb.setText("foo");
                // changes when the label changes
                System.out.println(jb.getActionCommand());

                jb.setText(null);
                // return null if the label is null
                System.out.println(jb.getActionCommand());

                jb.setActionCommand("baz");
                // as soon as the ac is set to a valid value return it
                System.out.println(jb.getActionCommand());

                jb.setText("bla");
                // and stay independent of the label changes
                System.out.println(jb.getActionCommand());

                jb.setText(null);
                // really
                System.out.println(jb.getActionCommand());

                jb.setActionCommand(null);
                jb.setText("bla");
                // revert to default behavior when ac is unset
                System.out.println(jb.getActionCommand());
        }
}


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=13691>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]