开发者

How to create same Command in Java ME

i want to use same command for another form in java me. i only see how to create commands but re use it on another form is not. is it possible or should i just copy paste my code to 开发者_开发百科other forms that ill make?


lcdui Command is plain old Java object, its instances can be reused and passed around just like any other Java objects

import javax.microedition.lcdui.Command;

// usage: CommandPool.cmdHello, CommandPool.cmdBye
public class CommandsPool {
    public static final Command
        cmdHello = new Command("Hello", Command.OK, 0),
        cmdBye = new Command("Bye", Command.EXIT, 0);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜