Class JIconList.IconItem

  • All Implemented Interfaces:
    IconProvider
    Enclosing class:
    JIconList<T>

    public static class JIconList.IconItem
    extends java.lang.Object
    implements IconProvider
    Provides basic list items that will show a specified label and icon in a JIconList.
    • Constructor Summary

      Constructors 
      Constructor Description
      IconItem​(java.lang.String label, javax.swing.Icon icon)
      Creates a new item that will display the specified label and icon when included in a JIconList.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.swing.Icon getIcon()
      Returns the icon that was specified at construction.
      java.lang.String toString()
      Returns the item label that was specified at construction.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • IconItem

        public IconItem​(java.lang.String label,
                        javax.swing.Icon icon)
        Creates a new item that will display the specified label and icon when included in a JIconList. A null label will be treated as an empty string.
        Parameters:
        label - the item's label
        icon - the item's icon
    • Method Detail

      • getIcon

        public javax.swing.Icon getIcon()
        Returns the icon that was specified at construction.
        Specified by:
        getIcon in interface IconProvider
        Returns:
        the item's icon
      • toString

        public java.lang.String toString()
        Returns the item label that was specified at construction.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the item's label