47 * in a button group
48 * because <code>JButton</code> and <code>JMenuItem</code>
49 * don't implement the selected state.
50 * <p>
51 * Initially, all buttons in the group are unselected.
52 * <p>
53 * For examples and further information on using button groups see
54 * <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/button.html#radiobutton">How to Use Radio Buttons</a>,
55 * a section in <em>The Java Tutorial</em>.
56 * <p>
57 * <strong>Warning:</strong>
58 * Serialized objects of this class will not be compatible with
59 * future Swing releases. The current serialization support is
60 * appropriate for short term storage or RMI between applications running
61 * the same version of Swing. As of 1.4, support for long term storage
62 * of all JavaBeans™
63 * has been added to the <code>java.beans</code> package.
64 * Please see {@link java.beans.XMLEncoder}.
65 *
66 * @author Jeff Dinkins
67 */
68 @SuppressWarnings("serial")
69 public class ButtonGroup implements Serializable {
70
71 // the list of buttons participating in this group
72 protected Vector<AbstractButton> buttons = new Vector<AbstractButton>();
73
74 /**
75 * The current selection.
76 */
77 ButtonModel selection = null;
78
79 /**
80 * Creates a new <code>ButtonGroup</code>.
81 */
82 public ButtonGroup() {}
83
84 /**
85 * Adds the button to the group.
86 * @param b the button to be added
|
47 * in a button group
48 * because <code>JButton</code> and <code>JMenuItem</code>
49 * don't implement the selected state.
50 * <p>
51 * Initially, all buttons in the group are unselected.
52 * <p>
53 * For examples and further information on using button groups see
54 * <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/button.html#radiobutton">How to Use Radio Buttons</a>,
55 * a section in <em>The Java Tutorial</em>.
56 * <p>
57 * <strong>Warning:</strong>
58 * Serialized objects of this class will not be compatible with
59 * future Swing releases. The current serialization support is
60 * appropriate for short term storage or RMI between applications running
61 * the same version of Swing. As of 1.4, support for long term storage
62 * of all JavaBeans™
63 * has been added to the <code>java.beans</code> package.
64 * Please see {@link java.beans.XMLEncoder}.
65 *
66 * @author Jeff Dinkins
67 * @since 1.2
68 */
69 @SuppressWarnings("serial")
70 public class ButtonGroup implements Serializable {
71
72 // the list of buttons participating in this group
73 protected Vector<AbstractButton> buttons = new Vector<AbstractButton>();
74
75 /**
76 * The current selection.
77 */
78 ButtonModel selection = null;
79
80 /**
81 * Creates a new <code>ButtonGroup</code>.
82 */
83 public ButtonGroup() {}
84
85 /**
86 * Adds the button to the group.
87 * @param b the button to be added
|