Java me 为什么命令按钮没有显示在我的模拟器中?
我已经在表单中添加了5个Cammand,我想添加第六个,但它不显示第六个 我在下面张贴我的代码Java me 为什么命令按钮没有显示在我的模拟器中?,java-me,midp,Java Me,Midp,我已经在表单中添加了5个Cammand,我想添加第六个,但它不显示第六个 我在下面张贴我的代码 public Command getOk_Lastjourney() { if (Ok_Lastjourney == null) { // write pre-init user code here Ok_Lastjourney = new Command("Last Journey", Command.OK, 0);
public Command getOk_Lastjourney() {
if (Ok_Lastjourney == null) {
// write pre-init user code here
Ok_Lastjourney = new Command("Last Journey", Command.OK, 0);
// write post-init user code here
}
return Ok_Lastjourney;
}
public Form getFrm_planjourney() {
if (frm_planjourney == null) {
// write pre-init user code here
frm_planjourney = new Form("Plan journey", new Item[] { getTxt_From(), getTxt_To(), getCg_usertype(), getCg_userpref(), getCg_searchalgo() });
frm_planjourney.addCommand(getExt_planjourney());
frm_planjourney.addCommand(getOk_planjourney());
frm_planjourney.addCommand(getOk_planFare());
frm_planjourney.addCommand(getOk_planDistance());
frm_planjourney.addCommand(getOk_planTime());
frm_planjourney.addCommand(getOk_planRoute());
frm_planjourney.setCommandListener(this);
// write post-init user code here
System.out.println("Appending.....");
System.out.println("Append completed...");
System.out.println(frm_planjourney.size());
frm_planjourney.setItemStateListener(this);
}
return frm_planjourney;
}
给定System.out.println,我想您是在用emulator调试,对吗?在这种情况下,提供一个屏幕截图来显示第六个图形的显示方式将非常有用
最有可能的情况是,您得到的命令太多,无法适应分配的区域,因此其中一些命令在滚动之前不会显示。还有一种可能是,第六个命令被重新分配给了其他软按钮,而您没有注意到这一点。或者还有别的事情——你提供的细节很难说
一般注意事项-在MIDP UI中,使用命令处理六个操作可能不是最佳选择。对于这样的东西,请考虑使用。隐式列表允许比命令更可靠和用户友好的设计