< prev index next >

src/java.desktop/share/classes/javax/swing/JTabbedPane.java

Print this page

        

@@ -44,24 +44,24 @@
  * clicking on a tab with a given title and/or icon.
  * For examples and information on using tabbed panes see
  * <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/tabbedpane.html">How to Use Tabbed Panes</a>,
  * a section in <em>The Java Tutorial</em>.
  * <p>
- * Tabs/components are added to a <code>TabbedPane</code> object by using the
- * <code>addTab</code> and <code>insertTab</code> methods.
+ * Tabs/components are added to a {@code TabbedPane} object by using the
+ * {@code addTab} and {@code insertTab} methods.
  * A tab is represented by an index corresponding
  * to the position it was added in, where the first tab has an index equal to 0
  * and the last tab has an index equal to the tab count minus 1.
  * <p>
- * The <code>TabbedPane</code> uses a <code>SingleSelectionModel</code>
+ * The {@code TabbedPane} uses a {@code SingleSelectionModel}
  * to represent the set
  * of tab indices and the currently selected index.  If the tab count
  * is greater than 0, then there will always be a selected index, which
  * by default will be initialized to the first tab.  If the tab count is
  * 0, then the selected index will be -1.
  * <p>
- * The tab title can be rendered by a <code>Component</code>.
+ * The tab title can be rendered by a {@code Component}.
  * For example, the following produce similar results:
  * <pre>
  * // In this case the look and feel renders the title for the tab.
  * tabbedPane.addTab("Tab", myComponent);
  * // In this case the custom component is responsible for rendering the

@@ -72,16 +72,16 @@
  * The latter is typically used when you want a more complex user interaction
  * that requires custom components on the tab.  For example, you could
  * provide a custom component that animates or one that has widgets for
  * closing the tab.
  * <p>
- * If you specify a component for a tab, the <code>JTabbedPane</code>
+ * If you specify a component for a tab, the {@code JTabbedPane}
  * will not render any text or icon you have specified for the tab.
  * <p>
  * <strong>Note:</strong>
- * Do not use <code>setVisible</code> directly on a tab component to make it visible,
- * use <code>setSelectedComponent</code> or <code>setSelectedIndex</code> methods instead.
+ * Do not use {@code setVisible} directly on a tab component to make it visible,
+ * use {@code setSelectedComponent} or {@code setSelectedIndex} methods instead.
  * <p>
  * <strong>Warning:</strong> Swing is not thread safe. For more
  * information see <a
  * href="package-summary.html#threading">Swing's Threading
  * Policy</a>.

@@ -90,11 +90,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&trade;
- * 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}.
  *
  * @beaninfo
  *      attribute: isContainer true
  *    description: A component which provides a tab folder metaphor for

@@ -144,56 +144,56 @@
     protected SingleSelectionModel model;
 
     private boolean haveRegistered;
 
     /**
-     * The <code>changeListener</code> is the listener we add to the
+     * The {@code changeListener} is the listener we add to the
      * model.
      */
     protected ChangeListener changeListener = null;
 
     private final java.util.List<Page> pages;
 
     /* The component that is currently visible */
     private Component visComp = null;
 
     /**
-     * Only one <code>ChangeEvent</code> is needed per <code>TabPane</code>
+     * Only one {@code ChangeEvent} is needed per {@code TabPane}
      * instance since the
      * event's only (read-only) state is the source property.  The source
      * of events generated here is always "this".
      */
     protected transient ChangeEvent changeEvent = null;
 
     /**
-     * Creates an empty <code>TabbedPane</code> with a default
-     * tab placement of <code>JTabbedPane.TOP</code>.
+     * Creates an empty {@code TabbedPane} with a default
+     * tab placement of {@code JTabbedPane.TOP}.
      * @see #addTab
      */
     public JTabbedPane() {
         this(TOP, WRAP_TAB_LAYOUT);
     }
 
     /**
-     * Creates an empty <code>TabbedPane</code> with the specified tab placement
-     * of either: <code>JTabbedPane.TOP</code>, <code>JTabbedPane.BOTTOM</code>,
-     * <code>JTabbedPane.LEFT</code>, or <code>JTabbedPane.RIGHT</code>.
+     * Creates an empty {@code TabbedPane} with the specified tab placement
+     * of either: {@code JTabbedPane.TOP}, {@code JTabbedPane.BOTTOM},
+     * {@code JTabbedPane.LEFT}, or {@code JTabbedPane.RIGHT}.
      *
      * @param tabPlacement the placement for the tabs relative to the content
      * @see #addTab
      */
     public JTabbedPane(int tabPlacement) {
         this(tabPlacement, WRAP_TAB_LAYOUT);
     }
 
     /**
-     * Creates an empty <code>TabbedPane</code> with the specified tab placement
+     * Creates an empty {@code TabbedPane} with the specified tab placement
      * and tab layout policy.  Tab placement may be either:
-     * <code>JTabbedPane.TOP</code>, <code>JTabbedPane.BOTTOM</code>,
-     * <code>JTabbedPane.LEFT</code>, or <code>JTabbedPane.RIGHT</code>.
-     * Tab layout policy may be either: <code>JTabbedPane.WRAP_TAB_LAYOUT</code>
-     * or <code>JTabbedPane.SCROLL_TAB_LAYOUT</code>.
+     * {@code JTabbedPane.TOP}, {@code JTabbedPane.BOTTOM},
+     * {@code JTabbedPane.LEFT}, or {@code JTabbedPane.RIGHT}.
+     * Tab layout policy may be either: {@code JTabbedPane.WRAP_TAB_LAYOUT}
+     * or {@code JTabbedPane.SCROLL_TAB_LAYOUT}.
      *
      * @param tabPlacement the placement for the tabs relative to the content
      * @param tabLayoutPolicy the policy for laying out tabs when all tabs will not fit on one run
      * @exception IllegalArgumentException if tab placement or tab layout policy are not
      *            one of the above supported values

@@ -209,11 +209,11 @@
     }
 
     /**
      * Returns the UI object which implements the L&amp;F for this component.
      *
-     * @return a <code>TabbedPaneUI</code> object
+     * @return a {@code TabbedPaneUI} object
      * @see #setUI
      */
     public TabbedPaneUI getUI() {
         return (TabbedPaneUI)ui;
     }

@@ -262,58 +262,58 @@
         return uiClassID;
     }
 
 
     /**
-     * We pass <code>ModelChanged</code> events along to the listeners with
+     * We pass {@code ModelChanged} events along to the listeners with
      * the tabbedpane (instead of the model itself) as the event source.
      */
     protected class ModelListener implements ChangeListener, Serializable {
         public void stateChanged(ChangeEvent e) {
             fireStateChanged();
         }
     }
 
     /**
-     * Subclasses that want to handle <code>ChangeEvents</code> differently
-     * can override this to return a subclass of <code>ModelListener</code> or
-     * another <code>ChangeListener</code> implementation.
+     * Subclasses that want to handle {@code ChangeEvents} differently
+     * can override this to return a subclass of {@code ModelListener} or
+     * another {@code ChangeListener} implementation.
      *
      * @return a {@code ChangeListener}
      * @see #fireStateChanged
      */
     protected ChangeListener createChangeListener() {
         return new ModelListener();
     }
 
     /**
-     * Adds a <code>ChangeListener</code> to this tabbedpane.
+     * Adds a {@code ChangeListener} to this tabbedpane.
      *
-     * @param l the <code>ChangeListener</code> to add
+     * @param l the {@code ChangeListener} to add
      * @see #fireStateChanged
      * @see #removeChangeListener
      */
     public void addChangeListener(ChangeListener l) {
         listenerList.add(ChangeListener.class, l);
     }
 
     /**
-     * Removes a <code>ChangeListener</code> from this tabbedpane.
+     * Removes a {@code ChangeListener} from this tabbedpane.
      *
-     * @param l the <code>ChangeListener</code> to remove
+     * @param l the {@code ChangeListener} to remove
      * @see #fireStateChanged
      * @see #addChangeListener
      */
     public void removeChangeListener(ChangeListener l) {
         listenerList.remove(ChangeListener.class, l);
     }
 
    /**
-     * Returns an array of all the <code>ChangeListener</code>s added
-     * to this <code>JTabbedPane</code> with <code>addChangeListener</code>.
+     * Returns an array of all the {@code ChangeListener}s added
+     * to this {@code JTabbedPane} with {@code addChangeListener}.
      *
-     * @return all of the <code>ChangeListener</code>s added or an empty
+     * @return all of the {@code ChangeListener}s added or an empty
      *         array if no listeners have been added
      * @since 1.4
      */
     public ChangeListener[] getChangeListeners() {
         return listenerList.getListeners(ChangeListener.class);

@@ -471,16 +471,16 @@
     }
 
     /**
      * Sets the tab placement for this tabbedpane.
      * Possible values are:<ul>
-     * <li><code>JTabbedPane.TOP</code>
-     * <li><code>JTabbedPane.BOTTOM</code>
-     * <li><code>JTabbedPane.LEFT</code>
-     * <li><code>JTabbedPane.RIGHT</code>
+     * <li>{@code JTabbedPane.TOP}
+     * <li>{@code JTabbedPane.BOTTOM}
+     * <li>{@code JTabbedPane.LEFT}
+     * <li>{@code JTabbedPane.RIGHT}
      * </ul>
-     * The default value, if not set, is <code>SwingConstants.TOP</code>.
+     * The default value, if not set, is {@code SwingConstants.TOP}.
      *
      * @param tabPlacement the placement for the tabs relative to the content
      * @exception IllegalArgumentException if tab placement value isn't one
      *                          of the above valid values
      *

@@ -529,15 +529,15 @@
    /**
      * Sets the policy which the tabbedpane will use in laying out the tabs
      * when all the tabs will not fit within a single run.
      * Possible values are:
      * <ul>
-     * <li><code>JTabbedPane.WRAP_TAB_LAYOUT</code>
-     * <li><code>JTabbedPane.SCROLL_TAB_LAYOUT</code>
+     * <li>{@code JTabbedPane.WRAP_TAB_LAYOUT}
+     * <li>{@code JTabbedPane.SCROLL_TAB_LAYOUT}
      * </ul>
      *
-     * The default value, if not set by the UI, is <code>JTabbedPane.WRAP_TAB_LAYOUT</code>.
+     * The default value, if not set by the UI, is {@code JTabbedPane.WRAP_TAB_LAYOUT}.
      * <p>
      * Some look and feels might only support a subset of the possible
      * layout policies, in which case the value of this property may be
      * ignored.
      *

@@ -661,11 +661,11 @@
             accessibleContext.getAccessibleName());
     }
 
     /**
      * Returns the currently selected component for this tabbedpane.
-     * Returns <code>null</code> if there is no currently selected tab.
+     * Returns {@code null} if there is no currently selected tab.
      *
      * @return the component corresponding to the selected tab
      * @see #setSelectedComponent
      */
     @Transient

@@ -677,11 +677,11 @@
         return getComponentAt(index);
     }
 
     /**
      * Sets the selected component for this tabbedpane.  This
-     * will automatically set the <code>selectedIndex</code> to the index
+     * will automatically set the {@code selectedIndex} to the index
      * corresponding to the specified component.
      *
      * @param c the selected {@code Component} for this {@code TabbedPane}
      * @exception IllegalArgumentException if component not found in tabbed
      *          pane

@@ -769,14 +769,14 @@
         revalidate();
         repaint();
     }
 
     /**
-     * Adds a <code>component</code> and <code>tip</code>
-     * represented by a <code>title</code> and/or <code>icon</code>,
-     * either of which can be <code>null</code>.
-     * Cover method for <code>insertTab</code>.
+     * Adds a {@code component} and {@code tip}
+     * represented by a {@code title} and/or {@code icon},
+     * either of which can be {@code null}.
+     * Cover method for {@code insertTab}.
      *
      * @param title the title to be displayed in this tab
      * @param icon the icon to be displayed in this tab
      * @param component the component to be displayed when this tab is clicked
      * @param tip the tooltip to be displayed for this tab

@@ -787,13 +787,13 @@
     public void addTab(String title, Icon icon, Component component, String tip) {
         insertTab(title, icon, component, tip, pages.size());
     }
 
     /**
-     * Adds a <code>component</code> represented by a <code>title</code>
-     * and/or <code>icon</code>, either of which can be <code>null</code>.
-     * Cover method for <code>insertTab</code>.
+     * Adds a {@code component} represented by a {@code title}
+     * and/or {@code icon}, either of which can be {@code null}.
+     * Cover method for {@code insertTab}.
      *
      * @param title the title to be displayed in this tab
      * @param icon the icon to be displayed in this tab
      * @param component the component to be displayed when this tab is clicked
      *

@@ -803,13 +803,13 @@
     public void addTab(String title, Icon icon, Component component) {
         insertTab(title, icon, component, null, pages.size());
     }
 
     /**
-     * Adds a <code>component</code> represented by a <code>title</code>
+     * Adds a {@code component} represented by a {@code title}
      * and no icon.
-     * Cover method for <code>insertTab</code>.
+     * Cover method for {@code insertTab}.
      *
      * @param title the title to be displayed in this tab
      * @param component the component to be displayed when this tab is clicked
      *
      * @see #insertTab

@@ -818,14 +818,14 @@
     public void addTab(String title, Component component) {
         insertTab(title, null, component, null, pages.size());
     }
 
     /**
-     * Adds a <code>component</code> with a tab title defaulting to
+     * Adds a {@code component} with a tab title defaulting to
      * the name of the component which is the result of calling
-     * <code>component.getName</code>.
-     * Cover method for <code>insertTab</code>.
+     * {@code component.getName}.
+     * Cover method for {@code insertTab}.
      *
      * @param component the component to be displayed when this tab is clicked
      * @return the component
      *
      * @see #insertTab

@@ -839,12 +839,12 @@
         }
         return component;
     }
 
     /**
-     * Adds a <code>component</code> with the specified tab title.
-     * Cover method for <code>insertTab</code>.
+     * Adds a {@code component} with the specified tab title.
+     * Cover method for {@code insertTab}.
      *
      * @param title the title to be displayed in this tab
      * @param component the component to be displayed when this tab is clicked
      * @return the component
      *

@@ -859,13 +859,13 @@
         }
         return component;
     }
 
     /**
-     * Adds a <code>component</code> at the specified tab index with a tab
+     * Adds a {@code component} at the specified tab index with a tab
      * title defaulting to the name of the component.
-     * Cover method for <code>insertTab</code>.
+     * Cover method for {@code insertTab}.
      *
      * @param component the component to be displayed when this tab is clicked
      * @param index the position to insert this new tab
      * @return the component
      *

@@ -883,15 +883,15 @@
         }
         return component;
     }
 
     /**
-     * Adds a <code>component</code> to the tabbed pane.
-     * If <code>constraints</code> is a <code>String</code> or an
-     * <code>Icon</code>, it will be used for the tab title,
+     * Adds a {@code component} to the tabbed pane.
+     * If {@code constraints} is a {@code String} or an
+     * {@code Icon}, it will be used for the tab title,
      * otherwise the component's name will be used as the tab title.
-     * Cover method for <code>insertTab</code>.
+     * Cover method for {@code insertTab}.
      *
      * @param component the component to be displayed when this tab is clicked
      * @param constraints the object to be displayed in the tab
      *
      * @see #insertTab

@@ -910,15 +910,15 @@
             super.add(component, constraints);
         }
     }
 
     /**
-     * Adds a <code>component</code> at the specified tab index.
-     * If <code>constraints</code> is a <code>String</code> or an
-     * <code>Icon</code>, it will be used for the tab title,
+     * Adds a {@code component} at the specified tab index.
+     * If {@code constraints} is a {@code String} or an
+     * {@code Icon}, it will be used for the tab title,
      * otherwise the component's name will be used as the tab title.
-     * Cover method for <code>insertTab</code>.
+     * Cover method for {@code insertTab}.
      *
      * @param component the component to be displayed when this tab is clicked
      * @param constraints the object to be displayed in the tab
      * @param index the position to insert this new tab
      *

@@ -937,12 +937,12 @@
             super.add(component, constraints, index);
         }
     }
 
     /**
-     * Removes the tab at <code>index</code>.
-     * After the component associated with <code>index</code> is removed,
+     * Removes the tab at {@code index}.
+     * After the component associated with {@code index} is removed,
      * its visibility is reset to true to ensure it will be visible
      * if added to other containers.
      * @param index the index of the tab to be removed
      * @exception IndexOutOfBoundsException if index is out of range
      *            {@code (index < 0 || index >= tab count)}

@@ -1032,13 +1032,13 @@
         revalidate();
         repaint();
     }
 
     /**
-     * Removes the specified <code>Component</code> from the
-     * <code>JTabbedPane</code>. The method does nothing
-     * if the <code>component</code> is null.
+     * Removes the specified {@code Component} from the
+     * {@code JTabbedPane}. The method does nothing
+     * if the {@code component} is null.
      *
      * @param component the component to remove from the tabbedpane
      * @see #addTab
      * @see #removeTabAt
      */

@@ -1061,11 +1061,11 @@
 
     /**
      * Removes the tab and component which corresponds to the specified index.
      *
      * @param index the index of the component to remove from the
-     *          <code>tabbedpane</code>
+     *          {@code tabbedpane}
      * @exception IndexOutOfBoundsException if index is out of range
      *            {@code (index < 0 || index >= tab count)}
      * @see #addTab
      * @see #removeTabAt
      */

@@ -1073,11 +1073,11 @@
         removeTabAt(index);
     }
 
     /**
      * Removes all the tabs and their corresponding components
-     * from the <code>tabbedpane</code>.
+     * from the {@code tabbedpane}.
      *
      * @see #addTab
      * @see #removeTabAt
      */
     public void removeAll() {

@@ -1090,11 +1090,11 @@
             removeTabAt(tabCount);
         }
     }
 
     /**
-     * Returns the number of tabs in this <code>tabbedpane</code>.
+     * Returns the number of tabs in this {@code tabbedpane}.
      *
      * @return an integer specifying the number of tabbed pages
      */
     public int getTabCount() {
         return pages.size();

@@ -1102,16 +1102,16 @@
 
     /**
      * Returns the number of tab runs currently used to display
      * the tabs.
      * @return an integer giving the number of rows if the
-     *          <code>tabPlacement</code>
-     *          is <code>TOP</code> or <code>BOTTOM</code>
+     *          {@code tabPlacement}
+     *          is {@code TOP} or {@code BOTTOM}
      *          and the number of columns if
-     *          <code>tabPlacement</code>
-     *          is <code>LEFT</code> or <code>RIGHT</code>,
-     *          or 0 if there is no UI set on this <code>tabbedpane</code>
+     *          {@code tabPlacement}
+     *          is {@code LEFT} or {@code RIGHT},
+     *          or 0 if there is no UI set on this {@code tabbedpane}
      */
     public int getTabRunCount() {
         if (ui != null) {
             return ((TabbedPaneUI)ui).getTabRunCount(this);
         }

@@ -1120,46 +1120,46 @@
 
 
 // Getters for the Pages
 
     /**
-     * Returns the tab title at <code>index</code>.
+     * Returns the tab title at {@code index}.
      *
      * @param index  the index of the item being queried
-     * @return the title at <code>index</code>
+     * @return the title at {@code index}
      * @exception IndexOutOfBoundsException if index is out of range
      *            {@code (index < 0 || index >= tab count)}
      * @see #setTitleAt
      */
     public String getTitleAt(int index) {
         return pages.get(index).title;
     }
 
     /**
-     * Returns the tab icon at <code>index</code>.
+     * Returns the tab icon at {@code index}.
      *
      * @param index  the index of the item being queried
-     * @return the icon at <code>index</code>
+     * @return the icon at {@code index}
      * @exception IndexOutOfBoundsException if index is out of range
      *            {@code (index < 0 || index >= tab count)}
      *
      * @see #setIconAt
      */
     public Icon getIconAt(int index) {
         return pages.get(index).icon;
     }
 
     /**
-     * Returns the tab disabled icon at <code>index</code>.
-     * If the tab disabled icon doesn't exist at <code>index</code>
+     * Returns the tab disabled icon at {@code index}.
+     * If the tab disabled icon doesn't exist at {@code index}
      * this will forward the call to the look and feel to construct
      * an appropriate disabled Icon from the corresponding enabled
      * Icon. Some look and feels might not render the disabled Icon,
      * in which case it won't be created.
      *
      * @param index  the index of the item being queried
-     * @return the icon at <code>index</code>
+     * @return the icon at {@code index}
      * @exception IndexOutOfBoundsException if index is out of range
      *            {@code (index < 0 || index >= tab count)}
      *
      * @see #setDisabledIconAt
      */

@@ -1170,14 +1170,14 @@
         }
         return page.disabledIcon;
     }
 
     /**
-     * Returns the tab tooltip text at <code>index</code>.
+     * Returns the tab tooltip text at {@code index}.
      *
      * @param index  the index of the item being queried
-     * @return a string containing the tool tip text at <code>index</code>
+     * @return a string containing the tool tip text at {@code index}
      * @exception IndexOutOfBoundsException if index is out of range
      *            {@code (index < 0 || index >= tab count)}
      *
      * @see #setToolTipTextAt
      * @since 1.3

@@ -1185,45 +1185,45 @@
     public String getToolTipTextAt(int index) {
         return pages.get(index).tip;
     }
 
     /**
-     * Returns the tab background color at <code>index</code>.
+     * Returns the tab background color at {@code index}.
      *
      * @param index  the index of the item being queried
-     * @return the <code>Color</code> of the tab background at
-     *          <code>index</code>
+     * @return the {@code Color} of the tab background at
+     *          {@code index}
      * @exception IndexOutOfBoundsException if index is out of range
      *            {@code (index < 0 || index >= tab count)}
      *
      * @see #setBackgroundAt
      */
     public Color getBackgroundAt(int index) {
         return pages.get(index).getBackground();
     }
 
     /**
-     * Returns the tab foreground color at <code>index</code>.
+     * Returns the tab foreground color at {@code index}.
      *
      * @param index  the index of the item being queried
-     * @return the <code>Color</code> of the tab foreground at
-     *          <code>index</code>
+     * @return the {@code Color} of the tab foreground at
+     *          {@code index}
      * @exception IndexOutOfBoundsException if index is out of range
      *            {@code (index < 0 || index >= tab count)}
      *
      * @see #setForegroundAt
      */
     public Color getForegroundAt(int index) {
         return pages.get(index).getForeground();
     }
 
     /**
-     * Returns whether or not the tab at <code>index</code> is
+     * Returns whether or not the tab at {@code index} is
      * currently enabled.
      *
      * @param index  the index of the item being queried
-     * @return true if the tab at <code>index</code> is enabled;
+     * @return true if the tab at {@code index} is enabled;
      *          false otherwise
      * @exception IndexOutOfBoundsException if index is out of range
      *            {@code (index < 0 || index >= tab count)}
      *
      * @see #setEnabledAt

@@ -1231,14 +1231,14 @@
     public boolean isEnabledAt(int index) {
         return pages.get(index).isEnabled();
     }
 
     /**
-     * Returns the component at <code>index</code>.
+     * Returns the component at {@code index}.
      *
      * @param index  the index of the item being queried
-     * @return the <code>Component</code> at <code>index</code>
+     * @return the {@code Component} at {@code index}
      * @exception IndexOutOfBoundsException if index is out of range
      *            {@code (index < 0 || index >= tab count)}
      *
      * @see #setComponentAt
      */

@@ -1255,12 +1255,12 @@
      * @since 1.4
      * @param tabIndex the index of the tab that the mnemonic refers to
      * @return the key code which represents the mnemonic;
      *         -1 if a mnemonic is not specified for the tab
      * @exception IndexOutOfBoundsException if index is out of range
-     *            (<code>tabIndex</code> &lt; 0 ||
-     *              <code>tabIndex</code> &gt;= tab count)
+     *            ({@code tabIndex < 0 ||
+     *                    tabIndex >= tab count})
      * @see #setDisplayedMnemonicIndexAt(int,int)
      * @see #setMnemonicAt(int,int)
      */
     public int getMnemonicAt(int tabIndex) {
         checkIndex(tabIndex);

@@ -1276,12 +1276,12 @@
      * @since 1.4
      * @param tabIndex the index of the tab that the mnemonic refers to
      * @return index representing mnemonic character if one exists;
      *    otherwise returns -1
      * @exception IndexOutOfBoundsException if index is out of range
-     *            (<code>tabIndex</code> &lt; 0 ||
-     *              <code>tabIndex</code> &gt;= tab count)
+     *            ({@code tabIndex < 0 ||
+     *                    tabIndex >= tab count})
      * @see #setDisplayedMnemonicIndexAt(int,int)
      * @see #setMnemonicAt(int,int)
      */
     public int getDisplayedMnemonicIndexAt(int tabIndex) {
         checkIndex(tabIndex);

@@ -1289,21 +1289,21 @@
         Page page = pages.get(tabIndex);
         return page.getDisplayedMnemonicIndex();
     }
 
     /**
-     * Returns the tab bounds at <code>index</code>.  If the tab at
+     * Returns the tab bounds at {@code index}.  If the tab at
      * this index is not currently visible in the UI, then returns
-     * <code>null</code>.
-     * If there is no UI set on this <code>tabbedpane</code>,
-     * then returns <code>null</code>.
+     * {@code null}.
+     * If there is no UI set on this {@code tabbedpane},
+     * then returns {@code null}.
      *
      * @param index the index to be queried
-     * @return a <code>Rectangle</code> containing the tab bounds at
-     *          <code>index</code>, or <code>null</code> if tab at
-     *          <code>index</code> is not currently visible in the UI,
-     *          or if there is no UI set on this <code>tabbedpane</code>
+     * @return a {@code Rectangle} containing the tab bounds at
+     *          {@code index}, or {@code null} if tab at
+     *          {@code index} is not currently visible in the UI,
+     *          or if there is no UI set on this {@code tabbedpane}
      * @exception IndexOutOfBoundsException if index is out of range
      *            {@code (index < 0 || index >= tab count)}
      */
     public Rectangle getBoundsAt(int index) {
         checkIndex(index);

@@ -1315,12 +1315,12 @@
 
 
 // Setters for the Pages
 
     /**
-     * Sets the title at <code>index</code> to <code>title</code> which
-     * can be <code>null</code>.
+     * Sets the title at {@code index} to {@code title} which
+     * can be {@code null}.
      * The title is not shown if a tab component for this tab was specified.
      * An internal exception is raised if there is no tab at that index.
      *
      * @param index the tab index where the title should be set
      * @param title the title to be displayed in the tab

@@ -1354,15 +1354,15 @@
             repaint();
         }
     }
 
     /**
-     * Sets the icon at <code>index</code> to <code>icon</code> which can be
-     * <code>null</code>. This does not set disabled icon at <code>icon</code>.
+     * Sets the icon at {@code index} to {@code icon} which can be
+     * {@code null}. This does not set disabled icon at {@code icon}.
      * If the new Icon is different than the current Icon and disabled icon
      * is not explicitly set, the LookAndFeel will be asked to generate a disabled
-     * Icon. To explicitly set disabled icon, use <code>setDisableIconAt()</code>.
+     * Icon. To explicitly set disabled icon, use {@code setDisableIconAt()}.
      * The icon is not shown if a tab component for this tab was specified.
      * An internal exception is raised if there is no tab at that index.
      *
      * @param index the tab index where the icon should be set
      * @param icon the icon to be displayed in the tab

@@ -1402,12 +1402,12 @@
             repaint();
         }
     }
 
     /**
-     * Sets the disabled icon at <code>index</code> to <code>icon</code>
-     * which can be <code>null</code>.
+     * Sets the disabled icon at {@code index} to {@code icon}
+     * which can be {@code null}.
      * An internal exception is raised if there is no tab at that index.
      *
      * @param index the tab index where the disabled icon should be set
      * @param disabledIcon the icon to be displayed in the tab when disabled
      * @exception IndexOutOfBoundsException if index is out of range

@@ -1427,12 +1427,12 @@
             repaint();
         }
     }
 
     /**
-     * Sets the tooltip text at <code>index</code> to <code>toolTipText</code>
-     * which can be <code>null</code>.
+     * Sets the tooltip text at {@code index} to {@code toolTipText}
+     * which can be {@code null}.
      * An internal exception is raised if there is no tab at that index.
      *
      * @param index the tab index where the tooltip text should be set
      * @param toolTipText the tooltip text to be displayed for the tab
      * @exception IndexOutOfBoundsException if index is out of range

@@ -1458,14 +1458,14 @@
             haveRegistered = true;
         }
     }
 
     /**
-     * Sets the background color at <code>index</code> to
-     * <code>background</code>
-     * which can be <code>null</code>, in which case the tab's background color
-     * will default to the background color of the <code>tabbedpane</code>.
+     * Sets the background color at {@code index} to
+     * {@code background}
+     * which can be {@code null}, in which case the tab's background color
+     * will default to the background color of the {@code tabbedpane}.
      * An internal exception is raised if there is no tab at that index.
      * <p>
      * It is up to the look and feel to honor this property, some may
      * choose to ignore it.
      *

@@ -1491,14 +1491,14 @@
             }
         }
     }
 
     /**
-     * Sets the foreground color at <code>index</code> to
-     * <code>foreground</code> which can be
-     * <code>null</code>, in which case the tab's foreground color
-     * will default to the foreground color of this <code>tabbedpane</code>.
+     * Sets the foreground color at {@code index} to
+     * {@code foreground} which can be
+     * {@code null}, in which case the tab's foreground color
+     * will default to the foreground color of this {@code tabbedpane}.
      * An internal exception is raised if there is no tab at that index.
      * <p>
      * It is up to the look and feel to honor this property, some may
      * choose to ignore it.
      *

@@ -1524,11 +1524,11 @@
             }
         }
     }
 
     /**
-     * Sets whether or not the tab at <code>index</code> is enabled.
+     * Sets whether or not the tab at {@code index} is enabled.
      * An internal exception is raised if there is no tab at that index.
      *
      * @param index the tab index which should be enabled/disabled
      * @param enabled whether or not the tab should be enabled
      * @exception IndexOutOfBoundsException if index is out of range

@@ -1544,11 +1544,11 @@
             repaint();
         }
     }
 
     /**
-     * Sets the component at <code>index</code> to <code>component</code>.
+     * Sets the component at {@code index} to {@code component}.
      * An internal exception is raised if there is no tab at that index.
      *
      * @param index the tab index where this component is being placed
      * @param component the component for the tab
      * @exception IndexOutOfBoundsException if index is out of range

@@ -1616,24 +1616,24 @@
      * You should only ever have to call this if
      * you do not wish the default character to be underlined. For example, if
      * the text at tab index 3 was 'Apple Price', with a mnemonic of 'p',
      * and you wanted the 'P'
      * to be decorated, as 'Apple <u>P</u>rice', you would have to invoke
-     * <code>setDisplayedMnemonicIndex(3, 6)</code> after invoking
-     * <code>setMnemonicAt(3, KeyEvent.VK_P)</code>.
+     * {@code setDisplayedMnemonicIndex(3, 6)} after invoking
+     * {@code setMnemonicAt(3, KeyEvent.VK_P)}.
      * <p>Note that it is the programmer's responsibility to ensure
      * that each tab has a unique mnemonic or unpredictable results may
      * occur.
      *
      * @since 1.4
      * @param tabIndex the index of the tab that the mnemonic refers to
-     * @param mnemonicIndex index into the <code>String</code> to underline
-     * @exception IndexOutOfBoundsException if <code>tabIndex</code> is
+     * @param mnemonicIndex index into the {@code String} to underline
+     * @exception IndexOutOfBoundsException if {@code tabIndex} is
      *            out of range ({@code tabIndex < 0 || tabIndex >= tab
      *            count})
      * @exception IllegalArgumentException will be thrown if
-     *            <code>mnemonicIndex</code> is &gt;= length of the tab
+     *            {@code mnemonicIndex} is &gt;= length of the tab
      *            title , or &lt; -1
      * @see #setMnemonicAt(int,int)
      * @see #getDisplayedMnemonicIndexAt(int)
      *
      * @beaninfo

@@ -1655,25 +1655,25 @@
      * The mnemonic is the key which when combined with the look and feel's
      * mouseless modifier (usually Alt) will activate the specified
      * tab.
      * <p>
      * A mnemonic must correspond to a single key on the keyboard
-     * and should be specified using one of the <code>VK_XXX</code>
-     * keycodes defined in <code>java.awt.event.KeyEvent</code>
+     * and should be specified using one of the {@code VK_XXX}
+     * keycodes defined in {@code java.awt.event.KeyEvent}
      * or one of the extended keycodes obtained through
-     * <code>java.awt.event.KeyEvent.getExtendedKeyCodeForChar</code>.
+     * {@code java.awt.event.KeyEvent.getExtendedKeyCodeForChar}.
      * Mnemonics are case-insensitive, therefore a key event
      * with the corresponding keycode would cause the button to be
      * activated whether or not the Shift modifier was pressed.
      * <p>
      * This will update the displayed mnemonic property for the specified
      * tab.
      *
      * @since 1.4
      * @param tabIndex the index of the tab that the mnemonic refers to
      * @param mnemonic the key code which represents the mnemonic
-     * @exception IndexOutOfBoundsException if <code>tabIndex</code> is out
+     * @exception IndexOutOfBoundsException if {@code tabIndex} is out
      *            of range ({@code tabIndex < 0 || tabIndex >= tab count})
      * @see #getMnemonicAt(int)
      * @see #setDisplayedMnemonicIndexAt(int,int)
      *
      * @beaninfo

@@ -1692,15 +1692,15 @@
     }
 
 // end of Page setters
 
     /**
-     * Returns the first tab index with a given <code>title</code>,  or
+     * Returns the first tab index with a given {@code title},  or
      * -1 if no tab has this title.
      *
      * @param title the title for the tab
-     * @return the first tab index which matches <code>title</code>, or
+     * @return the first tab index which matches {@code title}, or
      *          -1 if no tab has this title
      */
     public int indexOfTab(String title) {
         for(int i = 0; i < getTabCount(); i++) {
             if (getTitleAt(i).equals(title == null? "" : title)) {

@@ -1709,15 +1709,15 @@
         }
         return -1;
     }
 
     /**
-     * Returns the first tab index with a given <code>icon</code>,
+     * Returns the first tab index with a given {@code icon},
      * or -1 if no tab has this icon.
      *
      * @param icon the icon for the tab
-     * @return the first tab index which matches <code>icon</code>,
+     * @return the first tab index which matches {@code icon},
      *          or -1 if no tab has this icon
      */
     public int indexOfTab(Icon icon) {
         for(int i = 0; i < getTabCount(); i++) {
             Icon tabIcon = getIconAt(i);

@@ -1769,13 +1769,13 @@
 
     /**
      * Returns the tooltip text for the component determined by the
      * mouse event location.
      *
-     * @param event  the <code>MouseEvent</code> that tells where the
+     * @param event  the {@code MouseEvent} that tells where the
      *          cursor is lingering
-     * @return the <code>String</code> containing the tooltip text
+     * @return the {@code String} containing the tooltip text
      */
     public String getToolTipText(MouseEvent event) {
         if (ui != null) {
             int index = ((TabbedPaneUI)ui).tabForCoordinate(this, event.getX(), event.getY());
 

@@ -1792,12 +1792,12 @@
         }
     }
 
 
     /**
-     * See <code>readObject</code> and <code>writeObject</code> in
-     * <code>JComponent</code> for more
+     * See {@code readObject} and {@code writeObject} in
+     * {@code JComponent} for more
      * information about serialization in Swing.
      */
     private void writeObject(ObjectOutputStream s) throws IOException {
         s.defaultWriteObject();
         if (getUIClassID().equals(uiClassID)) {

@@ -1807,12 +1807,12 @@
                 ui.installUI(this);
             }
         }
     }
 
-    /* Called from the <code>JComponent</code>'s
-     * <code>EnableSerializationFocusListener</code> to
+    /* Called from the {@code JComponent}'s
+     * {@code EnableSerializationFocusListener} to
      * do any Swing-specific pre-serialization configuration.
      */
     void compWriteObjectNotify() {
         super.compWriteObjectNotify();
         // If ToolTipText != null, then the tooltip has already been

@@ -1821,12 +1821,12 @@
             ToolTipManager.sharedInstance().unregisterComponent(this);
         }
     }
 
     /**
-     * See <code>readObject</code> and <code>writeObject</code> in
-     * <code>JComponent</code> for more
+     * See {@code readObject} and {@code writeObject} in
+     * {@code JComponent} for more
      * information about serialization in Swing.
      */
     private void readObject(ObjectInputStream s)
         throws IOException, ClassNotFoundException
     {

@@ -1853,16 +1853,16 @@
         }
     }
 
 
     /**
-     * Returns a string representation of this <code>JTabbedPane</code>.
+     * Returns a string representation of this {@code JTabbedPane}.
      * This method
      * is intended to be used only for debugging purposes, and the
      * content and format of the returned string may vary between
      * implementations. The returned string may be empty but may not
-     * be <code>null</code>.
+     * be {@code null}.
      *
      * @return  a string representation of this JTabbedPane.
      */
     protected String paramString() {
         String tabPlacementString;

@@ -1909,21 +1909,21 @@
         return accessibleContext;
     }
 
     /**
      * This class implements accessibility support for the
-     * <code>JTabbedPane</code> class.  It provides an implementation of the
+     * {@code JTabbedPane} class.  It provides an implementation of the
      * Java Accessibility API appropriate to tabbed pane user-interface
      * elements.
      * <p>
      * <strong>Warning:</strong>
      * 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&trade;
-     * 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}.
      */
     @SuppressWarnings("serial") // Same-version serialization only
     protected class AccessibleJTabbedPane extends AccessibleJComponent
         implements AccessibleSelection, ChangeListener {

@@ -2001,28 +2001,28 @@
             }
             return pages.get(i);
         }
 
         /**
-         * Gets the <code>AccessibleSelection</code> associated with
+         * Gets the {@code AccessibleSelection} associated with
          * this object.  In the implementation of the Java
          * Accessibility API for this class,
          * returns this object, which is responsible for implementing the
-         * <code>AccessibleSelection</code> interface on behalf of itself.
+         * {@code AccessibleSelection} interface on behalf of itself.
          *
          * @return this object
          */
         public AccessibleSelection getAccessibleSelection() {
            return this;
         }
 
         /**
-         * Returns the <code>Accessible</code> child contained at
-         * the local coordinate <code>Point</code>, if one exists.
+         * Returns the {@code Accessible} child contained at
+         * the local coordinate {@code Point}, if one exists.
          * Otherwise returns the currently selected tab.
          *
-         * @return the <code>Accessible</code> at the specified
+         * @return the {@code Accessible} at the specified
          *    location, if it exists
          */
         public Accessible getAccessibleAt(Point p) {
             int tab = ((TabbedPaneUI) ui).tabForCoordinate(JTabbedPane.this,
                                                            p.x, p.y);

@@ -2378,13 +2378,13 @@
     }
 
     /**
     * Sets the component that is responsible for rendering the
     * title for the specified tab.  A null value means
-    * <code>JTabbedPane</code> will render the title and/or icon for
+    * {@code JTabbedPane} will render the title and/or icon for
     * the specified tab.  A non-null value means the component will
-    * render the title and <code>JTabbedPane</code> will not render
+    * render the title and {@code JTabbedPane} will not render
     * the title and/or icon.
     * <p>
     * Note: The component must not be one that the developer has
     *       already added to the tabbed pane.
     *

@@ -2392,11 +2392,11 @@
     * @param component the component to render the title for the
     *                  specified tab
     * @exception IndexOutOfBoundsException if index is out of range
     *            {@code (index < 0 || index >= tab count)}
     * @exception IllegalArgumentException if component has already been
-    *            added to this <code>JTabbedPane</code>
+    *            added to this {@code JTabbedPane}
     *
     * @see #getTabComponentAt
     * @beaninfo
     *    preferred: true
     *    attribute: visualUpdate true

@@ -2417,14 +2417,14 @@
             firePropertyChange("indexForTabComponent", -1, index);
         }
     }
 
     /**
-     * Returns the tab component at <code>index</code>.
+     * Returns the tab component at {@code index}.
      *
      * @param index  the index of the item being queried
-     * @return the tab component at <code>index</code>
+     * @return the tab component at {@code index}
      * @exception IndexOutOfBoundsException if index is out of range
      *            {@code (index < 0 || index >= tab count)}
      *
      * @see #setTabComponentAt
      * @since 1.6
< prev index next >