Package ca.cgjennings.ui
Class JIconList.IconItem
- java.lang.Object
-
- ca.cgjennings.ui.JIconList.IconItem
-
- All Implemented Interfaces:
IconProvider
public static class JIconList.IconItem extends java.lang.Object implements IconProvider
Provides basic list items that will show a specified label and icon in aJIconList
.
-
-
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.
-
-
-
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 aJIconList
. Anull
label will be treated as an empty string.- Parameters:
label
- the item's labelicon
- the item's icon
-
-
Method Detail
-
getIcon
public javax.swing.Icon getIcon()
Returns the icon that was specified at construction.- Specified by:
getIcon
in interfaceIconProvider
- Returns:
- the item's icon
-
toString
public java.lang.String toString()
Returns the item label that was specified at construction.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the item's label
-
-