import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import 

public class J2ME_Test extends MIDlet implements CommandListener
{
    public J2ME_Test()
    {
	 m_exit = new Command("Exit", Command.EXIT, 1);
	 m_tb = new TextBox("Hello world MIDlet", "Hello World!", 25, 0);
    }

    protected void destroyApp(boolean arg0) throws MIDletStateChangeException
    {
		// TODO Auto-generated method stub

    }

    protected void pauseApp()
    {
    }

    protected void startApp() throws MIDletStateChangeException
    {
	m_tb.addCommand(m_exit);
	m_tb.setCommandListener(this);
	Display.getDisplay(this).setCurrent(m_tb);
    }

    public void commandAction(Command cmd, Displayable arg1)
    {
	if (cmd == m_exit)
	{
	    try
	    {
		destroyApp(false);
	    }
	    catch (MIDletStateChangeException e)
	    {
		e.printStackTrace();
	    }
	    notifyDestroyed();
	}
    }

    private Command	m_exit;
    private TextBox	m_tb;
}
