| | |
J2ME error - Unable to create MIDlet null
Thread Solved |
•
•
Join Date: Feb 2007
Posts: 27
Reputation:
Solved Threads: 1
Hi I am trying to write a simple J2ME application, (I've only started learning it), and am getting the following error:
Unable to create MIDlet null
java.lang.NullPointerException
at com.sun.midp.midlet.MIDletState.createMIDlet(+29)
at com.sun.midp.midlet.Selector.run(+22)
I don't know what's wrong. Any suggestions would be greatfully received. My code is as follows:
Thanks, sweetchuck
Unable to create MIDlet null
java.lang.NullPointerException
at com.sun.midp.midlet.MIDletState.createMIDlet(+29)
at com.sun.midp.midlet.Selector.run(+22)
I don't know what's wrong. Any suggestions would be greatfully received. My code is as follows:
Java Syntax (Toggle Plain Text)
import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class HelloWorld extends MIDlet implements CommandListener { private Display display; private TextBox textBox; private Command quitCommand; public void startApp() { display = Display.getDisplay(this); quitCommand = new Command("Quit", Command.SCREEN, 1); textBox = new TextBox("HelloWorld", "My first MIDlet", 40, 0); textBox.addCommand(quitCommand); textBox.setCommandListener(this); display.setCurrent(textBox); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void commandAction(Command choice, Displayable displayable) { if(choice == quitCommand) { destroyApp(false); //notifyDestroy(); } } }
Thanks, sweetchuck
Nel sogni, come in amore, non ci sono cose impossible
i willl tell the procedure..
just create a new project in emulator..
give project name for that HelloWorld and MIDlet Class Name also HelloWorld
then save the settings
and after tat save ur coding in that HelloWorld's src folder....
then come back to emulator..
click open project select HelloWorld Project then build and run..the project its working fine
just create a new project in emulator..
give project name for that HelloWorld and MIDlet Class Name also HelloWorld
then save the settings
and after tat save ur coding in that HelloWorld's src folder....
then come back to emulator..
click open project select HelloWorld Project then build and run..the project its working fine
Adios,
Vinod......
Vinod......
![]() |
Similar Threads
- error in my code (Java)
- javalang error (Java)
- Network Error unable to read url from host g.msn.com (Viruses, Spyware and other Nasties)
- Network error unable to read url from host g.msn.com: connection reset by peer (Viruses, Spyware and other Nasties)
Other Threads in the Java Forum
- Previous Thread: Cannot find symbol, Constructor...
- Next Thread: is it possible to change the icon for jar file...
| Thread Tools | Search this Thread |
add android api applet application applications array arrays automation bank binary bluetooth chat class clear client code codesnippet collections component converter database development dice digit eclipse equation error event formatingtextintooltipjava fractal functiontesting game givemetehcodez graphics gui health html hyper ide idea image infinite input int integer j2me java javame javaprojects jni jpanel julia linux list loop looping main map method methods mobile myregfun mysql netbeans newbie nonstatic openjavafx parameter pearl php print problem program programming project recursion repositories scanner scrollbar server set size sms sort sorting spamblocker sql sqlserver state storm string superclass swing swt text-file thread threads tree windows





