43 * configuring a button. Refer to <a href="Action.html#buttonActions">
44 * Swing Components Supporting <code>Action</code></a> for more
45 * details, and you can find more information in <a
46 * href="https://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How
47 * to Use Actions</a>, a section in <em>The Java Tutorial</em>.
48 * <p>
49 * See <a href="https://docs.oracle.com/javase/tutorial/uiswing/components/button.html">How to Use Buttons, Check Boxes, and Radio Buttons</a>
50 * in <em>The Java Tutorial</em>
51 * for information and examples of using buttons.
52 * <p>
53 * <strong>Warning:</strong> Swing is not thread safe. For more
54 * information see <a
55 * href="package-summary.html#threading">Swing's Threading
56 * Policy</a>.
57 * <p>
58 * <strong>Warning:</strong>
59 * Serialized objects of this class will not be compatible with
60 * future Swing releases. The current serialization support is
61 * appropriate for short term storage or RMI between applications running
62 * the same version of Swing. As of 1.4, support for long term storage
63 * of all JavaBeans™
64 * has been added to the <code>java.beans</code> package.
65 * Please see {@link java.beans.XMLEncoder}.
66 *
67 * @author Jeff Dinkins
68 * @since 1.2
69 */
70 @JavaBean(defaultProperty = "UIClassID", description = "An implementation of a \"push\" button.")
71 @SwingContainer(false)
72 @SuppressWarnings("serial")
73 public class JButton extends AbstractButton implements Accessible {
74
75 /**
76 * @see #getUIClassID
77 * @see #readObject
78 */
79 private static final String uiClassID = "ButtonUI";
80
81 /**
82 * Creates a button with no set text or icon.
83 */
277 @BeanProperty(bound = false, expert = true, description
278 = "The AccessibleContext associated with this Button.")
279 public AccessibleContext getAccessibleContext() {
280 if (accessibleContext == null) {
281 accessibleContext = new AccessibleJButton();
282 }
283 return accessibleContext;
284 }
285
286 /**
287 * This class implements accessibility support for the
288 * <code>JButton</code> class. It provides an implementation of the
289 * Java Accessibility API appropriate to button user-interface
290 * elements.
291 * <p>
292 * <strong>Warning:</strong>
293 * Serialized objects of this class will not be compatible with
294 * future Swing releases. The current serialization support is
295 * appropriate for short term storage or RMI between applications running
296 * the same version of Swing. As of 1.4, support for long term storage
297 * of all JavaBeans™
298 * has been added to the <code>java.beans</code> package.
299 * Please see {@link java.beans.XMLEncoder}.
300 */
301 @SuppressWarnings("serial")
302 protected class AccessibleJButton extends AccessibleAbstractButton {
303
304 /**
305 * Get the role of this object.
306 *
307 * @return an instance of AccessibleRole describing the role of the
308 * object
309 * @see AccessibleRole
310 */
311 public AccessibleRole getAccessibleRole() {
312 return AccessibleRole.PUSH_BUTTON;
313 }
314 } // inner class AccessibleJButton
315 }
|
43 * configuring a button. Refer to <a href="Action.html#buttonActions">
44 * Swing Components Supporting <code>Action</code></a> for more
45 * details, and you can find more information in <a
46 * href="https://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How
47 * to Use Actions</a>, a section in <em>The Java Tutorial</em>.
48 * <p>
49 * See <a href="https://docs.oracle.com/javase/tutorial/uiswing/components/button.html">How to Use Buttons, Check Boxes, and Radio Buttons</a>
50 * in <em>The Java Tutorial</em>
51 * for information and examples of using buttons.
52 * <p>
53 * <strong>Warning:</strong> Swing is not thread safe. For more
54 * information see <a
55 * href="package-summary.html#threading">Swing's Threading
56 * Policy</a>.
57 * <p>
58 * <strong>Warning:</strong>
59 * Serialized objects of this class will not be compatible with
60 * future Swing releases. The current serialization support is
61 * appropriate for short term storage or RMI between applications running
62 * the same version of Swing. As of 1.4, support for long term storage
63 * of all JavaBeans
64 * has been added to the <code>java.beans</code> package.
65 * Please see {@link java.beans.XMLEncoder}.
66 *
67 * @author Jeff Dinkins
68 * @since 1.2
69 */
70 @JavaBean(defaultProperty = "UIClassID", description = "An implementation of a \"push\" button.")
71 @SwingContainer(false)
72 @SuppressWarnings("serial")
73 public class JButton extends AbstractButton implements Accessible {
74
75 /**
76 * @see #getUIClassID
77 * @see #readObject
78 */
79 private static final String uiClassID = "ButtonUI";
80
81 /**
82 * Creates a button with no set text or icon.
83 */
277 @BeanProperty(bound = false, expert = true, description
278 = "The AccessibleContext associated with this Button.")
279 public AccessibleContext getAccessibleContext() {
280 if (accessibleContext == null) {
281 accessibleContext = new AccessibleJButton();
282 }
283 return accessibleContext;
284 }
285
286 /**
287 * This class implements accessibility support for the
288 * <code>JButton</code> class. It provides an implementation of the
289 * Java Accessibility API appropriate to button user-interface
290 * elements.
291 * <p>
292 * <strong>Warning:</strong>
293 * Serialized objects of this class will not be compatible with
294 * future Swing releases. The current serialization support is
295 * appropriate for short term storage or RMI between applications running
296 * the same version of Swing. As of 1.4, support for long term storage
297 * of all JavaBeans
298 * has been added to the <code>java.beans</code> package.
299 * Please see {@link java.beans.XMLEncoder}.
300 */
301 @SuppressWarnings("serial")
302 protected class AccessibleJButton extends AccessibleAbstractButton {
303
304 /**
305 * Get the role of this object.
306 *
307 * @return an instance of AccessibleRole describing the role of the
308 * object
309 * @see AccessibleRole
310 */
311 public AccessibleRole getAccessibleRole() {
312 return AccessibleRole.PUSH_BUTTON;
313 }
314 } // inner class AccessibleJButton
315 }
|