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

Print this page

        

*** 22,46 **** * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.swing; 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 --- 22,41 ---- * 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 javax.swing.plaf.*; import javax.accessibility.*; import java.io.ObjectOutputStream; 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,83 **** * 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 */ @SuppressWarnings("serial") public class JButton extends AbstractButton implements Accessible { /** * @see #getUIClassID --- 62,76 ---- * 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}. * * @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,167 **** * 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. */ public String getUIClassID() { return uiClassID; } --- 147,159 ---- * that renders this component. * * @return the string "ButtonUI" * @see JComponent#getUIClassID * @see UIDefaults#getUI */ + @BeanProperty(bound = false, expert = true, description + = "A string that specifies the name of the L&amp;F class.") public String getUIClassID() { return uiClassID; }
*** 174,186 **** * 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 */ public boolean isDefaultButton() { JRootPane root = SwingUtilities.getRootPane(this); if (root != null) { return root.getDefaultButton() == this; } --- 166,178 ---- * to access the default button. * * @return the value of the <code>defaultButton</code> property * @see JRootPane#setDefaultButton * @see #isDefaultCapable */ + @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,223 **** * * @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 */ public void setDefaultCapable(boolean defaultCapable) { boolean oldDefaultCapable = this.defaultCapable; this.defaultCapable = defaultCapable; firePropertyChange("defaultCapable", oldDefaultCapable, defaultCapable); } --- 201,213 ---- * * @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 */ + @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,294 **** * <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. */ public AccessibleContext getAccessibleContext() { if (accessibleContext == null) { accessibleContext = new AccessibleJButton(); } return accessibleContext; --- 271,283 ---- * <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> */ + @BeanProperty(bound = false, expert = true, description + = "The AccessibleContext associated with this Button.") public AccessibleContext getAccessibleContext() { if (accessibleContext == null) { accessibleContext = new AccessibleJButton(); } return accessibleContext;