Midlet Hello World Sample

JUNAIDIX™ Laboratories

 

File: HelloWorld.java
Create new file, copy and paste code below..

//sample

import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

public class HelloMIDlet extends MIDlet implements CommandListener
{
private Form MainForm;

public HelloMIDlet()
{
MainForm = new Form("HelloWorld");
MainForm.append(new StringItem(null, "Hello...!"));
MainForm.addCommand(new Command("Exit", Command.EXIT, 0));
MainForm.setCommandListener(this);
}

public void startApp()
{
Display.getDisplay(this).setCurrent(mMainForm);
}

public void pauseApp() {}

public void destroyApp(boolean unconditional) {}

public void commandAction(Command c, Displayable s)
{
notifyDestroyed();
}
}// end class


Copyright © 2004 JUNAIDIX™ Laboratories
Hosted by www.Geocities.ws

1