import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class HelloWorld extends MIDlet implements CommandListener
{
	Command exitCommand;
	Display display;

	public HelloWorld()
	{
		display = Display.getDisplay(this);
		exitCommand = new Command("Exit",Command.SCREEN,2);
	}

	public void startApp()
	{
		TextBox textbox = new TextBox("HelloWorld","Hello World!",256,0);
		textbox.addCommand(exitCommand);
		textbox.setCommandListener(this);
		display.setCurrent(textbox);
	}

	public void pauseApp()
	{
	}

	public void destroyApp(boolean unconditional)
	{
	}

	public void commandAction(Command command,Displayable screen)
	{
		if(command==exitCommand)
		{
			destroyApp(false);
			notifyDestroyed();
		}
	}
}

