
Originally Posted by
ramtrg
I am using Lwuit 1.3 and Netbeans for my Application.
I have two classes.
In first class, i show a form(screen),
In second class, i show another form.
From second class, if i click on Back command,it will show First form(previous form present in first class). How to do this.Plz Help me....
Example Coding:
class c1
{
Form f1=new Form("First Form");
f1.show();
}
class c2
{
Form f2=new Form("Second Form");
f2.addCommand(new Command(){public void actionPerformed(){
f1.show();//Is it Correct
}});
f2.show();
}
Nope that is not correct.
You have to override the actionperformed() method in your form, and inside that you need to check that whether the command was back, if yes then using the MIDlet, display object and set the previous form as the current displayable.
PHP Code:
public void actionPerformed(ActionEvent event) {
// You can check here that event.getCommand().getId() is equal to the back command id,then change the displayable.
}