如何調用另一個表單?當我使用form.show()
方法時,不顯示另一個表單的組件。
例...在J2ME中使用LWUIT庫。如何調用另一個表單?
FirstForm.java
public class FirstForm extends MIDlet implements ActionListener
{
Form frm_first = new Form("First");
public Command cmd_Login;
public void startApp()
{
Display.init(this);
cmd_Login = new Command("Login");
frm_first.addComponent(cmd_login);
......
}
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
public void actionPerformed(ActionEvent ae)
{
Command cmd = ae.getCommand();
String strcmdName = cmd.getCommandName();
if (strcmdName.equals("Login"))
{
//how to call Login Form
}
}
}
Login.java
public class Login extends Form implements ActionListener
{
Form frm_Login = new Form("Login");
Button btn_Login = new Button("Login");
public Login()
{
....
. ....
}
}
嘿sajid感謝重播yaar。在登錄表單中必須定義組件的所有定義在登錄構造函數中。如果不是什麼是solution.plz舉一些例子。非常感謝你 –
它幾乎是必要的........ –
你沒有另一種選擇 –