juansusan 发表于 2013-1-27 04:58:49

j2me怎么做画面跳转

首先确定Form上添加Item还是addCommand(Command c)。

1.如果是前者,在这个Form上实现一个ItemCommandListener接口,然后做一个select按钮,再对每个Item调用setDefaultCommand(select)和setItemCommandListener(this);最后在实现接口时自动跳出来的itemCommandAction(Command command, Item item)函数内,根据item来决定跳转的界面。跳转通过Display类的setCurrent(Displayable d)来实现。
2.如果是后者,首先要实现一个CommandListener接口,然后用addCommand(Command c)添加按钮。再在commandAction(Command command, Displayable d)里,根据command来决定应该setCurrent到哪个界面
页: [1]
查看完整版本: j2me怎么做画面跳转