src/java.desktop/share/classes/javax/swing/JButton.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -22,25 +22,20 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 package javax.swing;
 
+import java.beans.JavaBean;
+import java.beans.BeanProperty;
 import java.beans.ConstructorProperties;
 
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.image.*;
-
 import javax.swing.plaf.*;
-import javax.swing.event.*;
 import javax.accessibility.*;
 
 import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
 import java.io.IOException;
 
-
 /**
  * An implementation of a "push" button.
   * <p>
  * Buttons can be configured, and to some degree controlled, by
  * <code><a href="Action.html">Action</a></code>s.  Using an

@@ -67,17 +62,15 @@
  * the same version of Swing.  As of 1.4, support for long term storage
  * of all JavaBeans&trade;
  * has been added to the <code>java.beans</code> package.
  * Please see {@link java.beans.XMLEncoder}.
  *
- * @beaninfo
- *   attribute: isContainer false
- * description: An implementation of a \"push\" button.
- *
  * @author Jeff Dinkins
  * @since 1.2
  */
+@JavaBean(defaultProperty = "UIClassID", description = "An implementation of a \"push\" button.")
+@SwingContainer(false)
 @SuppressWarnings("serial")
 public class JButton extends AbstractButton implements Accessible {
 
     /**
      * @see #getUIClassID

@@ -154,14 +147,13 @@
      * that renders this component.
      *
      * @return the string "ButtonUI"
      * @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;
     }
 
 

@@ -174,13 +166,13 @@
      * to access the default button.
      *
      * @return the value of the <code>defaultButton</code> property
      * @see JRootPane#setDefaultButton
      * @see #isDefaultCapable
-     * @beaninfo
-     *  description: Whether or not this button is the default button
      */
+    @BeanProperty(bound = false, description
+            = "Whether or not this button is the default button")
     public boolean isDefaultButton() {
         JRootPane root = SwingUtilities.getRootPane(this);
         if (root != null) {
             return root.getDefaultButton() == this;
         }

@@ -209,15 +201,13 @@
      *
      * @param defaultCapable <code>true</code> if this button will be
      *        capable of being the default button on the
      *        <code>RootPane</code>; otherwise <code>false</code>
      * @see #isDefaultCapable
-     * @beaninfo
-     *        bound: true
-     *    attribute: visualUpdate true
-     *  description: Whether or not this button can be the default button
      */
+    @BeanProperty(visualUpdate = true, description
+            = "Whether or not this button can be the default button")
     public void setDefaultCapable(boolean defaultCapable) {
         boolean oldDefaultCapable = this.defaultCapable;
         this.defaultCapable = defaultCapable;
         firePropertyChange("defaultCapable", oldDefaultCapable, defaultCapable);
     }

@@ -281,14 +271,13 @@
      * <code>AccessibleJButton</code>.
      * A new <code>AccessibleJButton</code> instance is created if necessary.
      *
      * @return an <code>AccessibleJButton</code> that serves as the
      *         <code>AccessibleContext</code> of this <code>JButton</code>
-     * @beaninfo
-     *       expert: true
-     *  description: The AccessibleContext associated with this Button.
      */
+    @BeanProperty(bound = false, expert = true, description
+            = "The AccessibleContext associated with this Button.")
     public AccessibleContext getAccessibleContext() {
         if (accessibleContext == null) {
             accessibleContext = new AccessibleJButton();
         }
         return accessibleContext;