package Program; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class IntProf extends MIDlet implements CommandListener { private Display display; private Form profForm; private ChoiceGroup choiceGroup; private StringItem stringItem; private StringItem stringLogin; private Command exitButton; public IntProf() { display = Display.getDisplay(this); exitButton = new Command("Quitter", Command.EXIT, 1); } public void startApp() throws MIDletStateChangeException { createForm(this); } public int identification(String login, String password) { int i=0 ; if (login.equals("prof") & password.equals("prof")) { i = 2; } if (login.equals("etud") & password.equals("etud")) { i = 1; } if (login.equals("admin") & password.equals("admin")) { i = 3; } if (login.equals("invite") & password.equals("")) { i = 0; } return i; } public void pauseApp() { } public void destroyApp(boolean unconditional) { notifyDestroyed(); } public void commandAction (Command command, Displayable displayable) { if (command == exitButton) { destroyApp(false); notifyDestroyed(); } } public void createForm(final IntProf ref) { display = Display.getDisplay(this); profForm = new Form("Interface Professeurs"); stringLogin = new StringItem(null,"Selectionner votre choix"); stringItem = new StringItem(null,"Selectionner votre choix"); String choix[] = {"Envoyer un message", "Consulter les news","Consulter votre emploi du temps","Consulter les horaires des navettes"}; choiceGroup = new ChoiceGroup("Sélectionner",Choice.EXCLUSIVE,choix,null); profForm.append(stringLogin); profForm.append(stringItem); profForm.append(choiceGroup); profForm.addCommand(exitButton); profForm.setCommandListener(this); display.setCurrent(profForm); } }