beautypg.com

Hello world midlet – Siemens Java TC65 User Manual

Page 36

background image

TC65 JAVA User's Guide
Strictly confidential / Released

s

TC65 JAVA User's Guide_V05

Page 36 of 90

26.09.2005

6.3

Hello World MIDlet

Here is a sample HelloWorld program.

/**
* HelloWorld.java
*/

package example.helloworld;
import javax.microedition.midlet.*;
import java.io.*;

public class HelloWorld extends MIDlet {

/**
* HelloWorld - default constructor
*/
public HelloWorld() {
System.out.println("HelloWorld: Constructor");
}

/**
* startApp()
*/
public void startApp() throws MIDletStateChangeException {
System.out.println("HelloWorld: startApp");
System.out.println("\nHello World!\n");
destroyApp();
}

/**
* pauseApp()
*/
public void pauseApp() {
System.out.println("HelloWorld: pauseApp()");
}

/**
* destroyApp()
*/
public void destroyApp(boolean cond) {
System.out.println("HelloWorld: destroyApp(" + cond + ")");
notifyDestroyed();
}
}