日期:2014-05-20  浏览次数:20665 次

写第一个J2ME程序就不能运行,NetBeans下写的,大家来看看,哪儿出毛病了.
import   javax.microedition.midlet.*;
import   javax.microedition.lcdui.*;

public   class   DisplayableTest   extends   MIDlet   implements   CommandListener
{
        public   DisplayableTest()
        {}
       
        public   void   startApp()
        {
                Displayable   t   =   new   Form( " ");
                t.setTitle( "Displayable ");
                t.setTicker(new   Ticker( "滚动文字 "));
                t.addCommand(new   Command( "退出命令 ",Command.SCREEN,2));
                t.setCommandListener(this);
                Display   display   =   Display.getDisplay(this);
                display.setCurrent(t);
        }
       
        public   void   pauseApp()
        {}
        public   void   destroyApp(boolean   unconditional)
        {}
        public   void   commandAction(Command   c,Displayable   s)
        {
                if(c.getLabel().equals( "退出命令 "))
                {
                        destroyApp(false);
                        notifyDestroyed();
                }
        }
}
编译提示:
pre-init:
pre-load-properties:
exists.config.active:
exists.netbeans.user:
exists.user.properties.file:
load-properties:
exists.platform.active:
exists.platform.configuration:
exists.platform.profile:
init:
post-init:
pre-preprocess:
deps-jar:
conditional-clean:
preprocess:
Pre-processing   0   file(s)   into   E:\J2ME\soft\Display\build\preprocessed   directory.
post-preprocess:
extract-libs:
pre-compile:
compile:
post-compile:
obfuscate-check:
pre-obfuscate:
obfuscate:
pre-preverify:
preverify:
post-preverify:
create-jad:
add-configuration:
add-profile:
set-keystore-password:
set-alias-password:
pre-jar:
jar:
Updating   application   descriptor:   E:\J2ME\soft\Display\dist\Display.jad
Application   descriptor   does   not   declare   any   MIDlet.   Direct   execution   is   not   allowed.
Generated   "E:\J2ME\soft\Display\dist\Display.jar "   is   1425   bytes.
post-jar:
run:
Copying   1   file   to   E:\J2ME\soft\Display\dist\nbrun15931
Copying   1   file   to   E:\J2ME\soft\Display\dist\nbrun15931
Starting   emulator   in   execution   mode
com.sun.kvem.midletsuite.InvalidJadException:   Reason   =   22
清单或应用程序描述符   MUST   包含属性:   MIDlet-1