使用 lwuit UI 库我不会破坏 j2me 应用程序
我正在使用 lwuit 处理 j2me 我有一个问题是,
当我在 midlet 中 startApp()
时,我首先设置 Display.init(this)
并运行应用程序 lwuit 工作良好但是当我在 midlet 中的 startApp()
事件中使用 Form 时,效果很好,但是在这个表单中,actionevent 我被称为新表单,并且在这个新表单中 当我按下它时,我放了一个后退命令,它不会在主 midlet 上移动,
请帮助如何知道 lwuit 使用
import javax.microedition.MIDlet;
import some lwuit UILibrary
public class mainMiddlet extends MIDlet implement ActionListner
{
public mainMiddlet(){
try{
Display.init(this);
//somthing is here
form=new Form();
form.addActionListener(this);
}catch(Exception e){}
}
public void actionperformed(ActionEven ae){
//here i call new form
//in action event of this form
new form().show();
}
//here some middlet default method
}
public class newForm extends Form {
//in this form I am put one command back and when i am pressed it
// I call mainMiddlet but it throw error internal application java.lang.nullpointer
// can I back on mainmiddlet from on form to another form
// my main problem is I am not move on mainmiddlet for exit middlet because destoryall()
// is method of middlet
}
I am working with j2me using lwuit I have one problem is that
when I am startApp()
inside midlet I first set Display.init(this)
and run application lwuit work good but when I am using Form inside startApp()
event in midlet it good work but in this form actionevent I am call new form and in this new form
I put one back command when I pressed it it does not move on main midlet
please help how know lwuit use
import javax.microedition.MIDlet;
import some lwuit UILibrary
public class mainMiddlet extends MIDlet implement ActionListner
{
public mainMiddlet(){
try{
Display.init(this);
//somthing is here
form=new Form();
form.addActionListener(this);
}catch(Exception e){}
}
public void actionperformed(ActionEven ae){
//here i call new form
//in action event of this form
new form().show();
}
//here some middlet default method
}
public class newForm extends Form {
//in this form I am put one command back and when i am pressed it
// I call mainMiddlet but it throw error internal application java.lang.nullpointer
// can I back on mainmiddlet from on form to another form
// my main problem is I am not move on mainmiddlet for exit middlet because destoryall()
// is method of middlet
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很简单。您可以在下一个表单返回命令中调用
show()
方法。例如,MainMidlet.java
NewForm.java
Its just simple. You can call the
show()
method inside next form back command. For example,MainMidlet.java
NewForm.java