Class SwingUtil.TabbedPaneIterator<O>

  • Type Parameters:
    O - the type of return elements.
    All Implemented Interfaces:
    Iterator<O>
    Enclosing class:
    SwingUtil

    public abstract static class SwingUtil.TabbedPaneIterator<O>
    extends Object
    implements Iterator<O>
    A simple iterator on a JTabbedPane.

    Implements the method get(int, Component) to obtain the data required given the component (or index).

    You can also inverse the order by usin the method reverse().

    Note: After the use of the method reverse() the iterator returns to the first element.

    Since:
    1.4
    • Constructor Detail

      • TabbedPaneIterator

        public TabbedPaneIterator​(boolean reverse,
                                  JTabbedPane tabs)
    • Method Detail

      • get

        protected abstract O get​(int index,
                                 Component comp)
      • reset

        public void reset()
      • size

        public int size()
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface Iterator<O>
      • getIndex

        public int getIndex()
      • next

        public O next()
        Specified by:
        next in interface Iterator<O>
      • remove

        public void remove()
        Specified by:
        remove in interface Iterator<O>
      • setReverse

        protected void setReverse​(boolean reverse)