public static class ListBox.IconItem
extends java.lang.Object
lb.add("this is a simple text"); lb.add(new IconItem("this is a text with icon", iconImage));The icon should have the same size of the font's height, which can be set with:
iconImage = originalImage.smoothScaledFixedAspectRatio(fmH, true, -1);
Modifier and Type | Field and Description |
---|---|
Image |
icon
This is the icon of the item.
|
Image |
iconRight
This is the icon of the item.
|
static int |
marginBorder |
java.lang.String |
text |
Constructor and Description |
---|
IconItem(java.lang.String text,
Image iconLeft)
This receives the item text and left icon.
|
IconItem(java.lang.String text,
Image iconLeft,
Image iconRight)
This receives the item text and the item left and right icons.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString() |
public java.lang.String text
public Image icon
public Image iconRight
public static int marginBorder
public IconItem(java.lang.String text, Image iconLeft)
text
- The item text.iconLeft
- The left icon of the item.public IconItem(java.lang.String text, Image iconLeft, Image iconRight)
text
- The item text.iconLeft
- The left icon of the item.iconRight
- The right icon of the item.