J2ME error - Unable to create MIDlet null

Thread Solved

Join Date: Feb 2007
Posts: 27
Reputation: mr.sweetchuck is an unknown quantity at this point 
Solved Threads: 1
mr.sweetchuck mr.sweetchuck is offline Offline
Light Poster

J2ME error - Unable to create MIDlet null

 
0
  #1
Feb 21st, 2007
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:

  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
Nel sogni, come in amore, non ci sono cose impossible
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 871
Reputation: vinod_javas is an unknown quantity at this point 
Solved Threads: 7
vinod_javas's Avatar
vinod_javas vinod_javas is offline Offline
Practically a Posting Shark

Re: J2ME error - Unable to create MIDlet null

 
0
  #2
Feb 21st, 2007
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 ??
Adios,

Vinod......
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 871
Reputation: vinod_javas is an unknown quantity at this point 
Solved Threads: 7
vinod_javas's Avatar
vinod_javas vinod_javas is offline Offline
Practically a Posting Shark

Re: J2ME error - Unable to create MIDlet null

 
0
  #3
Feb 21st, 2007
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
Adios,

Vinod......
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 27
Reputation: mr.sweetchuck is an unknown quantity at this point 
Solved Threads: 1
mr.sweetchuck mr.sweetchuck is offline Offline
Light Poster

Re: J2ME error - Unable to create MIDlet null

 
0
  #4
Feb 21st, 2007
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:
Nel sogni, come in amore, non ci sono cose impossible
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 871
Reputation: vinod_javas is an unknown quantity at this point 
Solved Threads: 7
vinod_javas's Avatar
vinod_javas vinod_javas is offline Offline
Practically a Posting Shark

Re: J2ME error - Unable to create MIDlet null

 
0
  #5
Feb 22nd, 2007
Fine Mr.SweetChuk
Adios,

Vinod......
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC