June 2004
Beginner to intermediate
364 pages
7h 38m
English
You want to display images in menu items.
Use the MenuItem class’s
setImage method.
You can pass an Image object to a
MenuItem object’s
setImage method to add an image to a menu item.
Here’s an example:
Display display = new Display ( );
final Image image = new Image (display, "c:\helpitem.jpg");
.
.
.
menuItem.setImage(image);Recipe 9.7 on creating a menu system; Recipe 9.8 on creating text menu items; Recipe 9.10 on creating radio menu items; Recipe 9.11 on creating menu item accelerators and mnemonics; Recipe 9.12 on enabling and disabling menu items; Chapter 8 in Eclipse (O’Reilly).
Read now
Unlock full access