Open main menu

CDOT Wiki β

Changes

4.b. Add Image to the Menu
==== 4.b. Add Image to the Menu ====
4.b.1. Run the application. Click on the menu you should see the followingCreate an abstract class that extends MenuItem to be used for creating items with image:<br/>[[Image: BB_Menu.png | 300px]]<br/>
<source lang="java">
 
/**
* Concrete implementation of abstract class MenuItem
}
}
</soursesource>  4.b.2. Change the instantiation of menu items to use the new class created ''ImageMenuItem'', pass the name of the menu item to the constructor:<br/><source lang="java">  ImageMenuItem addItem = new ImageMenuItem("Add Student", 100, 1, MENU_ADD); addItem.setCommand(new Command(new CommandHandler() {</source> [[Image: BB_Menu.png | 300px]]<br/>
1
edit