关于LWUIT中退出的问题

来源:互联网 发布:淘宝被管控的商品 编辑:程序博客网 时间:2024/06/08 19:40

LWUIT的退出是调用notifyDestroyed(); 我自己写了一个FORM(有构造方法并且实现了监听器) 在MIDlet 中实列化FORM 。 要在FORM 中退出。

我用命令(Command)退出 不行没效果。 我用按钮(Button)退出有效果。命令和按钮退出都有添加监听器(ActionListener)。

请问是什么原因:

/*

Command没效果

*/

        form.setTitle("Login");

        form.addCommand(new Command("Exit"){

            public void actionPerformd(ActionEvent ae){

                t.destroyApp(false);

                t.notifyDestroyed();

            }

        });

 

/*

Buttom有效果

*/

 

Button bexit = new Button(" 退      出 ");

        bexit.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {

                t.destroyApp(false);

                t.notifyDestroyed();

            }

});

 

原创粉丝点击