I appreciate if you provide me with an example to continue moving forward in my project.
public class MenuBar {
private Form current;
public void init(Object context) {
try {
// use two network threads instead of one
updateNetworkThreadCount(2);
Resources theme = Resources.openLayered("/theme");
UIManager.getInstance().setThemeProps(theme.getTheme(theme.getThemeResourceNames()[0]));
UIManager.getInstance().getLookAndFeel().setMenuBarClass(MenuBar.class);
} catch (IOException ex) {
}
}
public void start() {
if (current != null) {
current.show();
return;
}
Image imSelect = null;
Image imCancel = null;
Image imMenu = null;
try {
imSelect = Image.createImage("/m_brasilia.png");
imCancel = Image.createImage("/m_brasilia.png");
imMenu = Image.createImage("/m_brasilia.png");
} catch (IOException ex) {
}
//
Form menuBar = new Form("Menu Prueba");
menuBar.addCommand(new Command("Command 1", imSelect));
menuBar.addCommand(new Command("Command 2", imCancel));
menuBar.addCommand(new Command("Command 3", imMenu));
menuBar.addCommandListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
Dialog.show("WARNING !", ((Command) evt.getSource()).getCommandName() + " pressed !", "OK", null);
}
});
menuBar.show();
}
public void stop() {
current = getCurrentForm();
}
public void destroy() {
}
}