Kamis, 02 April 2015

Tugas Ummi Thaharani lubis, IS-6B

Diposting oleh Borkat Lubis di 02.17
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tugas;

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

/**
 * @author LENOVO
 */
public class tgsMidlet extends MIDlet implements CommandListener {

    Display disp;
    Form Satu,Dua,Tiga,Home;
    Command ExitCommand = new Command("Exit", Command.OK, 1);
    Command HomeCommand = new Command("Home", Command.OK, 1);
    Command backCommand = new Command("Back", Command.OK, 1);
    Command SatuCommand = new Command("Satu", Command.OK,1);
    Command DuaCommand  = new Command("Dua", Command.OK, 1);
    Command TigaCommand = new Command("Tiga", Command.OK, 1);
   
    public tgsMidlet ()
    {
        Home = new Form ("SELAMAT DATANG!");
        Home.addCommand(ExitCommand);
        Home.setCommandListener(this);
        Home.addCommand(SatuCommand);
        Home.addCommand(DuaCommand);
        Home.addCommand(TigaCommand);
       
       
       
        Satu = new Form ("Ini Adalah Halaman Pertama");
        Satu.addCommand(HomeCommand);
        Satu.setCommandListener(this);
        Satu.addCommand(DuaCommand);
        Satu.addCommand(TigaCommand);
        Satu.addCommand(ExitCommand);
        Satu.setCommandListener(this);
       
        Dua = new Form("Ini Adalah Halaman Kedua");
        Dua.addCommand(HomeCommand);
        Dua.setCommandListener(this);
        Dua.addCommand(SatuCommand);
        Dua.addCommand(TigaCommand);
        Dua.addCommand(ExitCommand);
        Dua.setCommandListener(this);
       
        Tiga = new Form("Ini Adalah Halaman Ketiga");
        Tiga.addCommand(HomeCommand);
        Tiga.setCommandListener(this);
        Tiga.addCommand(SatuCommand);
        Tiga.addCommand(DuaCommand);
        Tiga.addCommand(ExitCommand);
        Tiga.setCommandListener(this);
       

 }

    public void startApp() {
        if (disp == null) {
            disp = Display.getDisplay(this);
        }
       
        disp.setCurrent(Home);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }

    public void commandAction(Command c, Displayable d) {
        if (c == ExitCommand)
        {
            destroyApp(true);
            notifyDestroyed(); // Exit
        }
       
        else if (c == SatuCommand)
        {
            disp.setCurrent(Satu);
        }
       
        else if (c == DuaCommand)
        {
            disp.setCurrent(Dua);
        }
       
        else if (c == TigaCommand)
        {
            disp.setCurrent(Tiga);
        }
       
        else if (c == HomeCommand)
        {
            disp.setCurrent(Home);
        }
    }
}

   

0 komentar:

Posting Komentar

 

Ummi Thaharani Lubis Copyright © 2010 Design by Ipietoon Blogger Template Graphic from Enakei