Package totalcross.ui

Class ListBox.IconItem

  • Enclosing class:
    ListBox

    public static class ListBox.IconItem
    extends java.lang.Object
    Used to show an icon and a text. You can mix IconItem with other item types in the ListBox. 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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      Image icon  
      java.lang.String text  
    • Constructor Summary

      Constructors 
      Constructor Description
      IconItem​(java.lang.String text, Image icon)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • text

        public java.lang.String text
      • icon

        public Image icon
    • Constructor Detail

      • IconItem

        public IconItem​(java.lang.String text,
                        Image icon)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object