9.18. Adding Images to Table Items

Problem

You want to add images to table items.

Solution

To give a table item an image, call the item’s setImage method.

Discussion

Just pass a table item’s setImage method an Image object to give the item an image. For more on creating Image objects, take a look at Recipe 9.9 earlier in this chapter.

See Also

Recipe 9.9 on creating image menu items; Recipe 9.14 on creating tables; Recipe 9.16 on adding check marks to items in a table; Recipe 9.17 on enabling and disabling items in a table.

Get Eclipse Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.