Use the TreeItem class's setImage and getImage methods .
10.8.3 Discussion
To 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 Also
Recipe 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.