< Day Day Up > |
Recipe 10.8 Adding Images to Tree Items10.8.1 ProblemYou want to add images to tree items. 10.8.2 SolutionUse the TreeItem class's setImage and getImage methods. 10.8.3 DiscussionTo install an image for a tree item, pass the setImage method a new Image object. To see how to create Image objects, take a look at the Recipe 9.9 in Chapter 9. To get the image from a tree item, use the getImage method. 10.8.4 See AlsoRecipe 9.9 on creating image menu items; Recipe 10.5 on creating trees in SWT; Recipe 10.6 on handling tree events; Recipe 10.7 on adding checkboxes to tree items. |
< Day Day Up > |