944,121 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Marked Solved
  • Views: 6206
  • Java RSS
Feb 21st, 2007
0

J2ME error - Unable to create MIDlet null

Expand Post »
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:

Java Syntax (Toggle Plain Text)
  1. import javax.microedition.midlet.*;
  2. import javax.microedition.lcdui.*;
  3.  
  4. public class HelloWorld extends MIDlet implements CommandListener
  5. {
  6. private Display display;
  7. private TextBox textBox;
  8. private Command quitCommand;
  9.  
  10. public void startApp()
  11. {
  12. display = Display.getDisplay(this);
  13. quitCommand = new Command("Quit", Command.SCREEN, 1);
  14. textBox = new TextBox("HelloWorld", "My first MIDlet", 40, 0);
  15. textBox.addCommand(quitCommand);
  16. textBox.setCommandListener(this);
  17. display.setCurrent(textBox);
  18. }
  19.  
  20. public void pauseApp()
  21. {
  22. }
  23.  
  24. public void destroyApp(boolean unconditional)
  25. {
  26. }
  27.  
  28. public void commandAction(Command choice, Displayable displayable)
  29. {
  30. if(choice == quitCommand)
  31. {
  32. destroyApp(false);
  33. //notifyDestroy();
  34. }
  35. }
  36. }

Thanks, sweetchuck
Similar Threads
Reputation Points: 10
Solved Threads: 1
Light Poster
mr.sweetchuck is offline Offline
27 posts
since Feb 2007
Feb 21st, 2007
0

Re: J2ME error - Unable to create MIDlet null

Hey its working fine..in Wireless toolkit 2.2

Can u tell me in which version u r running....this project

else .. are u familiar with this tool kit r wat ??
Reputation Points: 119
Solved Threads: 7
Practically a Posting Shark
vinod_javas is offline Offline
871 posts
since Feb 2007
Feb 21st, 2007
0

Re: J2ME error - Unable to create MIDlet null

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
Reputation Points: 119
Solved Threads: 7
Practically a Posting Shark
vinod_javas is offline Offline
871 posts
since Feb 2007
Feb 21st, 2007
0

Re: J2ME error - Unable to create MIDlet null

Hi yeah, I was using Sun's Wireless Toolkit 2.5 and I've gotten it working. Simplest of problems. I was writing my own jads for nothing!

Thanks, again,
Mr.Sweetchuck:cheesy:
Reputation Points: 10
Solved Threads: 1
Light Poster
mr.sweetchuck is offline Offline
27 posts
since Feb 2007
Feb 22nd, 2007
0

Re: J2ME error - Unable to create MIDlet null

Fine Mr.SweetChuk
Reputation Points: 119
Solved Threads: 7
Practically a Posting Shark
vinod_javas is offline Offline
871 posts
since Feb 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Cannot find symbol, Constructor...
Next Thread in Java Forum Timeline: is it possible to change the icon for jar file...





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC