You are on page 1of 2

/* * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.io.

IOException; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; /** * @author Compaq CQ 43 */ public class tugasExample1 extends MIDlet implements CommandListener { Display display; List list; Form frm=new Form("input data mahasiswa"); TextField nama=new TextField("nama","",30,TextField.ANY); TextField nim=new TextField("nim","",15,TextField.NUMERIC); TextField email=new TextField("email","",30,TextField.EMAILADDR); TextBox Box1=new TextBox("informasi mahasiswa","",255,TextField.ANY); Command exit=new Command("Close",Command.EXIT,1); Command pilih=new Command("pilih",Command.OK,1); Command Ok=new Command("Ok",Command.EXIT,1); Command back=new Command("Back",Command.EXIT,1); Ticker tkr=new Ticker("Selamat Datang Di Website Politeknik Negeri Lhokseumawe B y: Arif Tiary"); public tugasExample1() throws IOException{ list=new List("Kemahasiswaan", List.EXCLUSIVE); list.append("input data mahasiswa", null); list.append("informasi", null); list.append("kegiatan", null); list.append("Contak Us", null); list.setTicker(tkr); frm.addCommand(Ok); frm.append(nama); frm.append(nim); frm.append(email); frm.setTicker(tkr); Box1.setTicker(tkr); Box1.addCommand(back); list.addCommand(pilih); list.addCommand(exit); list.setCommandListener(this); } public void startApp() { if(display==null){ display=Display.getDisplay(this); display.setCurrent(list); } } public void pauseApp() { } public void destroyApp(boolean unconditional) { }

public void commandAction(Command c, Displayable d) { if(c==exit){ destroyApp(true); notifyDestroyed(); } else if(c==pilih){ display.setCurrent(Box1); display.setCurrent(frm); } if(c==Ok){ destroyApp(true); notifyDestroyed(); display.setCurrent(list); { } } if(c==back){ destroyApp(true); notifyDestroyed(); display.setCurrent(list); } } }

You might also like