File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes Basics for a new comer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Basics for a new comer" Watch "Basics for a new comer" New topic

Basics for a new comer

Ransika deSilva
Ranch Hand

Joined: Feb 18, 2003
Posts: 524
Hi all,
Even though I am SCJP, I have no idea about J2ME programming. I want to try this one out as well.
So I have some problems. Could you please answer those. I have netBeans with me as the IDE. I have downloaded the wireless toolkit as well. I want to run a program. Atleast the "Hello world".

1) Where can I get the needed classes to write a mobile application.
2) Can I use netBeans to run the programs. If yes how can intergrate
those classes to netBeans.
3) How to run the program.
4) Can I transfer it to my real phone and check it. If yes how
Thank you very much for your time.

SCJP 1.4, SCMAD 1.0<br />SCWCD, SCBCD (in progress)
Zia Ahmed Shaikh

Joined: Apr 10, 2004
Posts: 2
Hi ;
To develop ur first J2me application you only have to perform few taska.
* click on KToolbar by selecting start menu > programs > J2me Wireless Toolkit > KToolbar.
* give the name for ur project and click CREATE PROJECT.(there is no need of giving class name at this time if it is not available.)
* now a directory structure has been created automatically.
* place the following code in src folder of ur project (c:\wtk104\apps\YourProject\src\
//code starts
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("Hello World","My only first MIDlet",40,0);
public void pauseApp(){
public void destroyApp(boolean uncontitional){
public void commandAction(Command choice,Displayable displayable)

//*******program ends*******

* Now click on BUILD button on KToolbar window.
* To run the application press RUN button
enjoy it....
Email me if u face any problem or u need its explanation.
Your friend Zia.
Paulo Aquino
Ranch Hand

Joined: Apr 29, 2002
Posts: 202
Followed you're should be saved as
At the same time: I'm getting this exception:

Project settings saved

Building "Test"

Build complete

Running with storage root temp.DefaultColorPhone1087708151000

Unable to create MIDlet null


at com.sun.midp.midlet.MIDletState.createMIDlet(+14)


Be Afraid...Be very Afraid...
Paulo Aquino
Ranch Hand

Joined: Apr 29, 2002
Posts: 202
I agree. Here's the link:
subject: Basics for a new comer
It's not a secret anymore!