[Frugalware-darcs] examples: initial import of a hello world midlet
VMiklos
vmiklos at frugalware.org
Tue Nov 28 19:19:07 CET 2006
Darcsweb-Url: http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=examples;a=darcs_commitdiff;h=20061128181831-e2957-2197ed12a60e297e78df9d113214943ee96796d1.gz;
[initial import of a hello world midlet
VMiklos <vmiklos at frugalware.org>**20061128181831] {
adddir ./midlet/HelloSuite
adddir ./midlet/HelloSuite/src
addfile ./midlet/HelloSuite/src/HelloMidlet.java
hunk ./midlet/HelloSuite/src/HelloMidlet.java 1
+import javax.microedition.lcdui.*;
+import javax.microedition.midlet.*;
+
+public class HelloMidlet extends MIDlet implements CommandListener
+{
+ private Form mMainForm;
+
+ public HelloMidlet()
+ {
+ mMainForm = new Form("title");
+ mMainForm.append(new StringItem(null, "content"));
+ mMainForm.addCommand(new Command("button", Command.EXIT, 0));
+ mMainForm.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();
+ }
+}
}
More information about the Frugalware-darcs
mailing list