【发布时间】:2012-02-10 16:31:00
【问题描述】:
如何调用另一个表单?当我使用form.show() 方法时,不显示另一个表单的组件。
例子……
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
}
}
}
登录.java
public class Login extends Form implements ActionListener
{
Form frm_Login = new Form("Login");
Button btn_Login = new Button("Login");
public Login()
{
....
. ....
}
}
【问题讨论】: