44 * <p>
45 * Buttons can be configured, and to some degree controlled, by
46 * <code><a href="Action.html">Action</a></code>s. Using an
47 * <code>Action</code> with a button has many benefits beyond directly
48 * configuring a button. Refer to <a href="Action.html#buttonActions">
49 * Swing Components Supporting <code>Action</code></a> for more
50 * details, and you can find more information in <a
51 * href="https://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How
52 * to Use Actions</a>, a section in <em>The Java Tutorial</em>.
53 * <p>
54 * <strong>Warning:</strong> Swing is not thread safe. For more
55 * information see <a
56 * href="package-summary.html#threading">Swing's Threading
57 * Policy</a>.
58 * <p>
59 * <strong>Warning:</strong>
60 * Serialized objects of this class will not be compatible with
61 * future Swing releases. The current serialization support is
62 * appropriate for short term storage or RMI between applications running
63 * the same version of Swing. As of 1.4, support for long term storage
64 * of all JavaBeans™
65 * has been added to the <code>java.beans</code> package.
66 * Please see {@link java.beans.XMLEncoder}.
67 *
68 * @see JRadioButton
69 *
70 * @author Jeff Dinkins
71 * @since 1.2
72 */
73 @JavaBean(description = "A component which can be selected or deselected.")
74 @SwingContainer(false)
75 @SuppressWarnings("serial") // Same-version serialization only
76 public class JCheckBox extends JToggleButton implements Accessible {
77
78 /** Identifies a change to the flat property. */
79 public static final String BORDER_PAINTED_FLAT_CHANGED_PROPERTY = "borderPaintedFlat";
80
81 private boolean flat = false;
82
83 /**
84 * @see #getUIClassID
308 @BeanProperty(bound = false, expert = true, description
309 = "The AccessibleContext associated with this CheckBox.")
310 public AccessibleContext getAccessibleContext() {
311 if (accessibleContext == null) {
312 accessibleContext = new AccessibleJCheckBox();
313 }
314 return accessibleContext;
315 }
316
317 /**
318 * This class implements accessibility support for the
319 * <code>JCheckBox</code> class. It provides an implementation of the
320 * Java Accessibility API appropriate to check box user-interface
321 * elements.
322 * <p>
323 * <strong>Warning:</strong>
324 * Serialized objects of this class will not be compatible with
325 * future Swing releases. The current serialization support is
326 * appropriate for short term storage or RMI between applications running
327 * the same version of Swing. As of 1.4, support for long term storage
328 * of all JavaBeans™
329 * has been added to the <code>java.beans</code> package.
330 * Please see {@link java.beans.XMLEncoder}.
331 */
332 @SuppressWarnings("serial") // Same-version serialization only
333 protected class AccessibleJCheckBox extends AccessibleJToggleButton {
334
335 /**
336 * Get the role of this object.
337 *
338 * @return an instance of AccessibleRole describing the role of the object
339 * @see AccessibleRole
340 */
341 public AccessibleRole getAccessibleRole() {
342 return AccessibleRole.CHECK_BOX;
343 }
344
345 } // inner class AccessibleJCheckBox
346 }
|
44 * <p>
45 * Buttons can be configured, and to some degree controlled, by
46 * <code><a href="Action.html">Action</a></code>s. Using an
47 * <code>Action</code> with a button has many benefits beyond directly
48 * configuring a button. Refer to <a href="Action.html#buttonActions">
49 * Swing Components Supporting <code>Action</code></a> for more
50 * details, and you can find more information in <a
51 * href="https://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How
52 * to Use Actions</a>, a section in <em>The Java Tutorial</em>.
53 * <p>
54 * <strong>Warning:</strong> Swing is not thread safe. For more
55 * information see <a
56 * href="package-summary.html#threading">Swing's Threading
57 * Policy</a>.
58 * <p>
59 * <strong>Warning:</strong>
60 * Serialized objects of this class will not be compatible with
61 * future Swing releases. The current serialization support is
62 * appropriate for short term storage or RMI between applications running
63 * the same version of Swing. As of 1.4, support for long term storage
64 * of all JavaBeans
65 * has been added to the <code>java.beans</code> package.
66 * Please see {@link java.beans.XMLEncoder}.
67 *
68 * @see JRadioButton
69 *
70 * @author Jeff Dinkins
71 * @since 1.2
72 */
73 @JavaBean(description = "A component which can be selected or deselected.")
74 @SwingContainer(false)
75 @SuppressWarnings("serial") // Same-version serialization only
76 public class JCheckBox extends JToggleButton implements Accessible {
77
78 /** Identifies a change to the flat property. */
79 public static final String BORDER_PAINTED_FLAT_CHANGED_PROPERTY = "borderPaintedFlat";
80
81 private boolean flat = false;
82
83 /**
84 * @see #getUIClassID
308 @BeanProperty(bound = false, expert = true, description
309 = "The AccessibleContext associated with this CheckBox.")
310 public AccessibleContext getAccessibleContext() {
311 if (accessibleContext == null) {
312 accessibleContext = new AccessibleJCheckBox();
313 }
314 return accessibleContext;
315 }
316
317 /**
318 * This class implements accessibility support for the
319 * <code>JCheckBox</code> class. It provides an implementation of the
320 * Java Accessibility API appropriate to check box user-interface
321 * elements.
322 * <p>
323 * <strong>Warning:</strong>
324 * Serialized objects of this class will not be compatible with
325 * future Swing releases. The current serialization support is
326 * appropriate for short term storage or RMI between applications running
327 * the same version of Swing. As of 1.4, support for long term storage
328 * of all JavaBeans
329 * has been added to the <code>java.beans</code> package.
330 * Please see {@link java.beans.XMLEncoder}.
331 */
332 @SuppressWarnings("serial") // Same-version serialization only
333 protected class AccessibleJCheckBox extends AccessibleJToggleButton {
334
335 /**
336 * Get the role of this object.
337 *
338 * @return an instance of AccessibleRole describing the role of the object
339 * @see AccessibleRole
340 */
341 public AccessibleRole getAccessibleRole() {
342 return AccessibleRole.CHECK_BOX;
343 }
344
345 } // inner class AccessibleJCheckBox
346 }
|