Hey,
Before setting the value of the button's selected property to true, i
added a check that ensures that state first be set to true.
2006-06-13 Tania Bento <[EMAIL PROTECTED]>
* classpath/javax/swing/JCheckBoxMenuItem.java
(JCheckBoxMenuItem): Added check to set the selected state.
Index: JCheckBoxMenuItem.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JCheckBoxMenuItem.java,v
retrieving revision 1.16
diff -u -r1.16 JCheckBoxMenuItem.java
--- JCheckBoxMenuItem.java 14 May 2006 21:00:28 -0000 1.16
+++ JCheckBoxMenuItem.java 13 Jun 2006 15:20:24 -0000
@@ -1,39 +1,39 @@
/* JCheckBoxMenuItem.java --
/**
- * Creates a new JCheckBoxMenuItem object with given label, icon,
- * and marked as checked if given 'state' is true.
- *
+ * Creates a new JCheckBoxMenuItem object with given label, icon, and marked
+ * as checked if given 'state' is true.
+ *
* @param text Label for this menu item
* @param icon icon for this menu item
- * @param state <code>true</code> if this item should be in checked state and
- * false otherwise
+ * @param state <code>true</code> if this item should be in checked state
+ * and false otherwise
*/
public JCheckBoxMenuItem(String text, Icon icon, boolean state)
{
@@ -148,12 +148,14 @@
setModel(new JToggleButton.ToggleButtonModel());
this.state = state;
this.setVisible(true);
+ if (state == true)
+ this.setSelected(true);
}