资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

一个helloworld级的问题

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

一个使用了接口CommandListener的程序在模拟器上没有问题,在真机上就有问题  
   
  Error   verifying   class   Helloworld  
   
  请问这是怎么引起的呀,应怎样解决呢?谢谢  
   
  我还找了个类似的程序,放在真机上也没问题!  
   
  我的代码:  
   
  import   javax.microedition.midlet.*;  
  import   javax.microedition.lcdui.*;  
  public   class   HelloMIDlet   extends   MIDlet   implements   CommandListener  
  {  
    private   Command   exitCommand;  
    private   Display   display;  
    public   HelloMIDlet()  
    {  
      display=Display.getDisplay(this);  
      exitCommand=new   Command("Exit",Command.SCREEN,2);  
    }  
  public   void   startApp()  
  {  
  TextBox   t=new   TextBox("","helloworld",256,0);  
  t.addCommand(exitCommand);  
  t.setCommandListener(this);  
  display.setCurrent(t);  
  }  
  public   void   pauseApp()  
  {  
  }  
  public   void   destroyApp(boolean   unconditional)  
  {  
  }  
  public   void   commandAction(Command   arg0,Displayable   arg1)  
  {  
  if   (arg0==exitCommand){  
      destroyApp(false);  
      notifyDestroyed();  
  }  
  }  
  }  
   
 

网友回答:

发表者:Tasia

编译产生class文件,还要用preverify命令对它进行预审核。  
  C:\>d:\midp\bin\preverify   -classpath   d:\midp\classes;.   -d   HelloMIDlet   HelloMIDlet

发表者:aheroofeast

装到手机上应该有两个文件。  
   
  helloWorld.jad  
  helloWorld.jar  
   
  你用的什么工具编译的》?  
  wtk2.1是在project菜单里package->create   package,  
  完成后,在bin目录下就能找到这两个文件了。


 

 
热门推荐笔记本: 清华紫光笔记本
相关文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved