Home | J2ME Yours page | Favorite Links | Contact Me | objques | Canvas Demo | Fruit selection | Commands | Gauge NI | Gauge Response | Pallet | Pal Ex Mid | Slides Text
Prasad's J2ME programs
Command Demo

Enter subhead content here

import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;

public class ComPriMid extends MIDlet {

private Display display;
private Form mform;
private Command cexit,cundo,ccut,cpaste,cdelete,cselectall;

public ComPriMid(){
display = Display.getDisplay(this);
mform = new Form("Form for Command Demo");

cexit = new Command("Exit",Command.EXIT,1);
cundo = new Command("Undo",Command.EXIT,1);
ccut  = new Command("Cut",Command.EXIT,1);
cpaste = new Command("Paste",Command.EXIT,1);
cdelete = new Command("Delete",Command.EXIT,1);
cselectall = new Command("SelectAll",Command.EXIT,1);

mform.addCommand(cexit);
mform.addCommand(cundo);
mform.addCommand(ccut);
mform.addCommand(cpaste);
mform.addCommand(cdelete);
mform.addCommand(cselectall);

}//end of constructor
public void startApp(){
display.setCurrent(mform);
}

public void pauseApp(){}
public void destroyApp(boolean unconditional){}

public void commandAction(Command c , Displayable dis){
if( c == cexit)
notifyDestroyed();
}

}//end of class ComPriMid


Enter supporting content here

"Striving for success without hard work is like trying to harvest where you haven't planted."