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