Skip to main content

error to focus on command button in new GUI

1 reply [Last post]
sahoorashmita
Offline
Joined: 2011-03-23
Points: 0

Hello All,

I create one application that was first created form GUI Latest Resources Editor. In that form i have one ok button and when i will click an Ok button then i will create an form through coding and i write a code of creating my next form in the validation of Ok button that is

protected boolean onFormOk() {
// If the resource file changes the names of components this call will break notifying you that you should fix the code
boolean val = super.onFormOk();
Form f=new Form("Demo");

f.addCommand(new Command("Ok")
{
public void actionPerformed(ActionEvent ae) {
SecondForm.show();
}
});

f.addCommand(new Command("Back")
{
public void actionPerformed(ActionEvent ae) {
FirstForm.show();
}
});

f.show();
return val;
}

When i use touch screen then ok and back command will work but when i use simple emulators then ok and back command doesn't work or i can't focus on it. Only it will display on the screen but not worked when i click left or right softbutton of the emulator.

So please help me to solve this error as soon as earlier and send me some example to how can i do it.

Advance Thank you and sorry for my english.

Rashmita Sahoo

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
Points: 0

Which theme are you using. Check if the commandBehavior constant is defined to anything and remove that definition from the theme.