jdk/src/share/classes/javax/swing/JCheckBox.java

Print this page

        

@@ -22,22 +22,20 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 package javax.swing;
 
-import java.awt.*;
-import java.awt.event.*;
-import java.beans.*;
+import java.beans.JavaBean;
+import java.beans.BeanProperty;
 
 import javax.swing.plaf.*;
 import javax.accessibility.*;
 
 import java.io.ObjectOutputStream;
 import java.io.ObjectInputStream;
 import java.io.IOException;
 
-
 /**
  * An implementation of a check box -- an item that can be selected or
  * deselected, and which displays its state to the user.
  * By convention, any number of check boxes in a group can be selected.
  * See <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/button.html">How to Use Buttons, Check Boxes, and Radio Buttons</a>

@@ -67,17 +65,15 @@
  * has been added to the <code>java.beans</code> package.
  * Please see {@link java.beans.XMLEncoder}.
  *
  * @see JRadioButton
  *
- * @beaninfo
- *   attribute: isContainer false
- * description: A component which can be selected or deselected.
- *
  * @author Jeff Dinkins
  * @since 1.2
  */
+@JavaBean(description = "A component which can be selected or deselected.")
+@SwingContainer(false)
 @SuppressWarnings("serial") // Same-version serialization only
 public class JCheckBox extends JToggleButton implements Accessible {
 
     /** Identifies a change to the flat property. */
     public static final String BORDER_PAINTED_FLAT_CHANGED_PROPERTY = "borderPaintedFlat";

@@ -193,16 +189,14 @@
      * they will ignore this property.
      *
      * @param b <code>true</code> requests that the border be painted flat;
      *          <code>false</code> requests normal borders
      * @see #isBorderPaintedFlat
-     * @beaninfo
-     *        bound: true
-     *    attribute: visualUpdate true
-     *  description: Whether the border is painted flat.
      * @since 1.3
      */
+    @BeanProperty(visualUpdate = true, description
+            = "Whether the border is painted flat.")
     public void setBorderPaintedFlat(boolean b) {
         boolean oldValue = flat;
         flat = b;
         firePropertyChange(BORDER_PAINTED_FLAT_CHANGED_PROPERTY, oldValue, flat);
         if (b != oldValue) {

@@ -237,14 +231,13 @@
      * that renders this component.
      *
      * @return the string "CheckBoxUI"
      * @see JComponent#getUIClassID
      * @see UIDefaults#getUI
-     * @beaninfo
-     *        expert: true
-     *   description: A string that specifies the name of the L&amp;F class
      */
+    @BeanProperty(bound = false, expert = true, description
+            = "A string that specifies the name of the L&amp;F class")
     public String getUIClassID() {
         return uiClassID;
     }
 
 

@@ -309,14 +302,13 @@
      * AccessibleJCheckBox.
      * A new AccessibleJCheckBox instance is created if necessary.
      *
      * @return an AccessibleJCheckBox that serves as the
      *         AccessibleContext of this JCheckBox
-     * @beaninfo
-     *       expert: true
-     *  description: The AccessibleContext associated with this CheckBox.
      */
+    @BeanProperty(bound = false, expert = true, description
+            = "The AccessibleContext associated with this CheckBox.")
     public AccessibleContext getAccessibleContext() {
         if (accessibleContext == null) {
             accessibleContext = new AccessibleJCheckBox();
         }
         return accessibleContext;