import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.media.*;
import java.io.*;


public class aleppo_university extends MIDlet implements CommandListener
{

private Display display;
Command cmdExit  = new Command("خروج", Command.EXIT, 1);
Command cmdBack  = new Command("عودة", Command.BACK, 0);
Command cmdNext  = new Command("التالي", Command.ITEM, 2);

 Ticker ticker;
 Form form;
 TextField field ;
 int  n = 0 ;
 public aleppo_university()
  {
   display =Display.getDisplay(this);
   field  = new TextField("","",20,0);
   ticker = new Ticker(",welcome in Syria ,   communication engineering ,Dr ENG HANADY  ");

          }

 public void startApp()
  {
   form   = new Form("WELCOME IN COMMUNICATION ENGINEERING ");
   form.append("WELCOME IN J2ME (JAVA 2 MICRO EDITION),EVERY week We shall see new program   ");
   field.setString("");
   form.addCommand(cmdNext);
   form.addCommand(cmdExit);
   form.setCommandListener(this);
   form.setTicker(new Ticker("welcome in Syria,communication engineering ,Dr ENG HANADY"));
   display.setCurrent(form);
  }

public void show(int n)
{

 switch(n)

{

    case 1   :
                      form.append("");
              form.setTitle("communication eng,Dr ENG HANADY "+n+"");
              field.setString("");
                          form.removeCommand(cmdBack);
              break;
        case 2   :
                  form.append("in the the first week we are going to see how can i do JAD ,JAR  FILE which is the most inportant thing to run programe on mobile... ");
              form.setTitle("communication eng,Dr ENG HANADY  "+n+"");

              try{
                        Player p = Manager.createPlayer("/basel.wav");
                        p.start();
                   }
                catch(MediaException pe){}
                catch(IOException e){}

                          field.setString("");
                  form.addCommand(cmdBack);
                  break;
   case 3 :
                  form.append("IN the next week we are going to see how i can  do command,canvas(Graphics)class,text box and .....also");
              form.setTitle("communication eng,Dr ENG HANADY  "+n+"");
                          field.setString("");
                  form.addCommand(cmdBack);
                  break;
  case  4 :
                  form.append("IN the third week ,We are going to see how i can do forme ,items,Gauge,text feild");
              form.setTitle("communication eng,Dr ENG HANADY  "+n+"");
                  field.setString("");


                  try{
     Image img = Image.createImage(
                                       "/Test.png");
     form.append(img);
   } catch (java.io.IOException e)
      {
         Alert alert = new Alert ( "Error: Load Image" );
         alert.setString( e.getMessage() );
         display.setCurrent(alert);
       }





                          form.addCommand(cmdBack);
                     break;
 case  5 :    form.append("IN the fourth week we have to know how i can deal with RMS (THE RECORD MANAGEMENT SYSTEMS,WE offer diary sample  )");
                  form.setTitle("communication eng,Dr ENG HANADY  "+n+"");
                  field.setString("");
                          form.addCommand(cmdBack);
                     break;
 case 6 :
                  form.append("IN THE fifth week we offer internat browser ,so we speak about WAP  protocal ");
                  form.setTitle("communication eng,Dr ENG HANADY  "+n+"");
                  field.setString("");
                          form.addCommand(cmdBack);
                     break;
case 7 :
                  form.append("in the next week we are going to do sample about 3D ");
                  form.setTitle("communication eng,Dr ENG HANADY  "+n+"");
                  field.setString("");
                          form.addCommand(cmdBack);
                     break;
case 8 :
                  form.append(" IN THE TENTH WEEK WE OFFER BLUEOOTH SAMPLE ");
              form.setTitle("communication eng,Dr ENG HANADY  "+n+"");
                  field.setString("");
                          form.addCommand(cmdBack);
                     break;

case 9 :
                  form.append("if you find any difiicult just ask me for any help ..GOOOOOOOOOOOOOD BY");
                  form.setTitle("communication eng,Dr ENG HANADY  "+n+"");
                  field.setString("");
                          form.addCommand(cmdBack);
                     break;

case 10 :
                 form.append("CONTACT ME ON MAIL....ALLRIGHT_82@HOTMAIL.COM....GOOD LOUCK...Basel Ammar");
             form.setTitle("communication eng,Dr ENG HANADY  "+n+"");
                 field.setString("");
                         form.addCommand(cmdBack);
                         form.removeCommand(cmdNext);
                    break;
}
                  form.setCommandListener(this);
              form.setTicker(new Ticker("welcome in Syria ,communication engineering ,Dr ENG HANADY"));
                          form.delete(0);
              display.setCurrent(form);
                  n = n + 1 ;

}


 public void pauseApp(){ }
 public void destroyApp(boolean unconditional){}






/************* implements CommandListener ****************/
public void commandAction(Command c, Displayable s)
{
  if (  s == form )
     {
       if (c == cmdExit)
         {
           destroyApp(false);
           notifyDestroyed();
         }
          else if (c == cmdNext)
                 {

                         show(n+1);
                          n++;

                         }
                  else if (c == cmdBack)
                 {

                         show(n-1);
                         n--;

                 }
         }
                 }  // end commandAction
 }  // end Class
