IconCommand

The IconCommand class extends the LCDUI Command class by allowing MIDlets to provide an icon to a Command. On full touch devices, MIDlets can use IconCommands to map an icon to action button 1 and place icons in the CategoryBar. In general, MIDlets can use IconCommands anywhere they can use Commands. (Since IconCommand is a subclass of Command, an IconCommand instance can always substitute a Command instance.)

The IconCommand class is supported on Series 40 devices with Java Runtime 2.0.0 for Series 40 or newer.

An IconCommand differs from a Command only in terms of its visual appearance. While a Command is represented only by a text label, an IconCommand is represented by both a text label and an icon. The image data for the icon can come from a built-in system icon described using a unique ID or from image data provided by the MIDlet. When a MIDlet provides its own image data for an icon, it can provide both the selected and unselected versions of the image. However, only the unselected version of the icon image is mandatory.

MIDlets can dynamically change some IconCommand properties. If the IconCommand is visible when its property is changed, the change takes effect immediately. If the IconCommand is not visible, the change takes effect when the IconCommand next becomes visible.

More information

For more information about IconCommand see:

For example MIDlets that show you how to use IconCommands, see: