Package totalcross.ui
Class ListBox.IconItem
- java.lang.Object
-
- totalcross.ui.ListBox.IconItem
-
- Enclosing class:
- ListBox
public static class ListBox.IconItem extends java.lang.ObjectUsed to show an icon or two and a text. You can mix IconItem with other item types in the ListBox.
Tip: The icons are automatically resized by default. If you don't want this, please set autoResizeIcon to false.
Example: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);
- Since:
- TotalCross 1.61
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringtoString()
-
-
-
Constructor Detail
-
IconItem
public IconItem(java.lang.String text, Image iconLeft)This receives the item text and left icon. It is highly recommended the icon size be 24DP.
Tip: The icons are automatically resized by default. If you don't want this, please set autoResizeIcon to false.- Parameters:
text- The item text.iconLeft- The left icon of the item.
-
IconItem
public IconItem(java.lang.String text, Image iconLeft, Image iconRight)This receives the item text and the item left and right icons. It is highly recommended the icons sizes be 24DP.
Tip: The icons are automatically resized by default. If you don't want this, please set autoResizeIcon to false.- Parameters:
text- The item text.iconLeft- The left icon of the item.iconRight- The right icon of the item.
-
-