Creating your first MIDlet
Written by: maffelu , 2009-06-16 16:15:07
package org.morkalork.testExample;
import javax.microedition.midlet.*;
/** * @author maffelu */
public class MorkaMIDlet extends MIDlet {
public void startApp() {
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.Form;
private Display display;
display = Display.getDisplay(this);
private Form myForm;
//Contructor
public MorkaMIDlet(){
StringItem strItem = new StringItem("This is a string item", "");
myForm = new Form("This is a title");
myForm.append(strItem);
}
public void initMIDler(){
display = Display.getDisplay(this);
display.setCurrent(myForm);
}
public void startApp() {
if(display == null)
initMIDler(); //Run the initMIDler method
}
package org.morkalork.testExample;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.Form;
/** * This MIDlet will output a form with a title and a * string item on it. * * @author maffelu */
public class MorkaMIDlet extends MIDlet {
private Display display;
private Form myForm;
//Contructor
public MorkaMIDlet(){
StringItem strItem = new StringItem("This is a string item", "");
myForm = new Form("This is a title");
myForm.append(strItem);
}
public void startApp() {
if(display == null)
initMIDler(); //Run the initMIDler method
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void initMIDler(){
display = Display.getDisplay(this);
display.setCurrent(myForm);
}
}
There are no comments on this article.
If you have any question or just want to leave a message, just fill out the form below!
Your e-mail will not be visible in your post, it is for validation reasons only
Maffelu
Creator and admin of MorkaLork.com.
Started programming in HTML back when frames and tables was the way to design a page, moved on to Pascal/Delphi, PHP, javascript/jQuery, VB.NET/C#, Java and C++.
Currently studies .NET (in general) focusing on ASP.NET.