Skip to main content

how to remove left soft button from right soft button menu list

56 replies [Last post]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07

Override createCommandList()

shankar_vn
Offline
Joined: 2009-11-03
kavitharajdurai
Offline
Joined: 2010-08-25

sorry i cant get any idea from that link. please try to give some guidelines about it. if possible give that sample code.

bhakki
Offline
Joined: 2009-09-09

override createCommandList in the form.
Like,

Form form = new Form(formName) {

protected List createCommandList(Vector commands) {
for (int i = 0; i < object.length; i++) {
commands.removeElement(...); - here pass the removable command object
}
List l = new List(commands);
l.setFixedSelection(List.FIXED_NONE_CYCLIC);
return l;
}
};

Bharath...

kavitharajdurai
Offline
Joined: 2010-08-25

thanks for your quick reply sir.

but i cant get idea abt where i can import that code.
i produce that code. plz tell where i can import that.
sorry sir, its urgent. please help me.

public void processFormHome()
{
UIManager.getInstance().getLookAndFeel().setReverseSoftButtons(true);

formHome=new Form();
formHome.setTitle("Home");

listHome = new List();
listHome.addItem("Think Music Apps");
listHome.addItem("Blog");
listHome.addItem("News");
listHome.getUnselectedStyle().setBgColor(0xf0ffff);
listHome.getSelectedStyle().setBgColor(0xff8c00);
listHome.setListCellRenderer(new DefaultListCellRenderer(false));
listHome.setListCellRenderer(new listRender());
formHome.addComponent(BorderLayout.CENTER, listHome);
listHome.addActionListener(this);

songsCommand = new Command("Songs",4);
moreCommand = new Command("More",3);
downloadsCommand = new Command("Downloads",2);
mainCommand = new Command("Back",1);
formHome.addCommand(mainCommand);
formHome.addCommand(downloadsCommand);
formHome.addCommand(moreCommand);
formHome.addCommand(songsCommand);

UIManager.getInstance().getLookAndFeel().setMenuRenderer(new MenuRenderer());
formHome.setMenuCellRenderer(new MenuRenderer());
formHome.addCommandListener(this);
formHome.setCommandListener(this);
formHome.show();

}

bhakki
Offline
Joined: 2009-09-09

initialize ur mainCommand b4 of form initialization and pass the ur mainCommand in vector.removeElement(mainCommand);

Bharath...