< prev index next >
src/java.desktop/share/classes/javax/swing/ButtonGroup.java
Print this page
@@ -30,24 +30,24 @@
import java.io.Serializable;
/**
* This class is used to create a multiple-exclusion scope for
* a set of buttons. Creating a set of buttons with the
- * same <code>ButtonGroup</code> object means that
+ * same {@code ButtonGroup} object means that
* turning "on" one of those buttons
* turns off all other buttons in the group.
* <p>
- * A <code>ButtonGroup</code> can be used with
- * any set of objects that inherit from <code>AbstractButton</code>.
+ * A {@code ButtonGroup} can be used with
+ * any set of objects that inherit from {@code AbstractButton}.
* Typically a button group contains instances of
- * <code>JRadioButton</code>,
- * <code>JRadioButtonMenuItem</code>,
- * or <code>JToggleButton</code>.
+ * {@code JRadioButton},
+ * {@code JRadioButtonMenuItem},
+ * or {@code JToggleButton}.
* It wouldn't make sense to put an instance of
- * <code>JButton</code> or <code>JMenuItem</code>
+ * {@code JButton} or {@code JMenuItem}
* in a button group
- * because <code>JButton</code> and <code>JMenuItem</code>
+ * because {@code JButton} and {@code JMenuItem}
* don't implement the selected state.
* <p>
* Initially, all buttons in the group are unselected.
* <p>
* For examples and further information on using button groups see
@@ -58,11 +58,11 @@
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
- * has been added to the <code>java.beans</code> package.
+ * has been added to the {@code java.beans} package.
* Please see {@link java.beans.XMLEncoder}.
*
* @author Jeff Dinkins
* @since 1.2
*/
@@ -78,11 +78,11 @@
* The current selection.
*/
ButtonModel selection = null;
/**
- * Creates a new <code>ButtonGroup</code>.
+ * Creates a new {@code ButtonGroup}.
*/
public ButtonGroup() {}
/**
* Adds the button to the group.
@@ -120,11 +120,11 @@
b.getModel().setGroup(null);
}
/**
* Clears the selection such that none of the buttons
- * in the <code>ButtonGroup</code> are selected.
+ * in the {@code ButtonGroup} are selected.
*
* @since 1.6
*/
public void clearSelection() {
if (selection != null) {
@@ -135,11 +135,11 @@
}
/**
* Returns all the buttons that are participating in
* this group.
- * @return an <code>Enumeration</code> of the buttons in this group
+ * @return an {@code Enumeration} of the buttons in this group
*/
public Enumeration<AbstractButton> getElements() {
return buttons.elements();
}
@@ -150,15 +150,15 @@
public ButtonModel getSelection() {
return selection;
}
/**
- * Sets the selected value for the <code>ButtonModel</code>.
+ * Sets the selected value for the {@code ButtonModel}.
* Only one button in the group may be selected at a time.
- * @param m the <code>ButtonModel</code>
- * @param b <code>true</code> if this button is to be
- * selected, otherwise <code>false</code>
+ * @param m the {@code ButtonModel}
+ * @param b {@code true} if this button is to be
+ * selected, otherwise {@code false}
*/
public void setSelected(ButtonModel m, boolean b) {
if (b && m != null && m != selection) {
ButtonModel oldSelection = selection;
selection = m;
< prev index next >