Upload
corneliuskoo
View
1.127
Download
4
Tags:
Embed Size (px)
Citation preview
J2ME Wireless Tool Kit (WTK)
Cornelius Koo - 2005
KToolBar
Start -> Programs -> J2ME Wireless ToolKit 2.0 -> KToolBar
Project File Organization
Create New Project
Open Existing Project
Editing MIDlet Suite Attribute
Modifying MIDlet Suite Attributes
Modifying User Defined Attributes
Modifying MIDlet-Specific Attributes
Simple Hello World
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.TextBox;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class HelloWorld extends MIDlet {
private Display display;
public HelloWorld() {
display = Display.getDisplay(this);
}
protected void startApp() throws MIDletStateChangeException {
TextBox t = new TextBox(“Hello World MIDlet","Hello Small World",256,0);
display.setCurrent(t);
}
protected void pauseApp() {}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {}
}
Save this HelloWorld.java file at WTK20\apps\Hello World\src
Building Application
Running Locally
Cleaning Up Project
This will remove unnecessary files from project folder
Packaging
External Libraries
Place the .JAR files inside this /lib
directory for specific project.
Place the .JAR files inside this /lib
directory for all projects
Reference
• WTK User Guide. SUN Microsystem,
2003.