Probleme pour afficher une appl J2ME
Résolu/Fermé
kakashi05
Messages postés
186
Date d'inscription
jeudi 28 juin 2007
Statut
Membre
Dernière intervention
12 août 2011
-
21 déc. 2008 à 16:49
kakashi05 Messages postés 186 Date d'inscription jeudi 28 juin 2007 Statut Membre Dernière intervention 12 août 2011 - 21 déc. 2008 à 17:03
kakashi05 Messages postés 186 Date d'inscription jeudi 28 juin 2007 Statut Membre Dernière intervention 12 août 2011 - 21 déc. 2008 à 17:03
A voir également:
- Probleme pour afficher une appl J2ME
- Afficher mot de passe wifi android - Guide
- Afficher appdata - Guide
- Afficher calendrier outlook dans google agenda - Guide
- Windows 11 afficher plus d'options - Guide
- Afficher mot de passe wifi - Guide
1 réponse
kakashi05
Messages postés
186
Date d'inscription
jeudi 28 juin 2007
Statut
Membre
Dernière intervention
12 août 2011
32
21 déc. 2008 à 17:03
21 déc. 2008 à 17:03
Probleme resolu
voila le nouveau code
voila le nouveau code
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import javax.obex.PasswordAuthentication; /** * @author Sangare */ public class Telephone1 extends MIDlet implements CommandListener{ private Display display; private TextField login, password; private Form form; private Command commandexit,commandok; private List list; private ChoiceGroup cg; public Telephone1(){ display=Display.getDisplay(this); //Affichage du message Bienvenu dans la barre des titres form =new Form("Bienvenu dans ce programme"); //Creation du champ login avec une taille maxi de 30 caracteres login=new TextField("Login","", 30, TextField.ANY); //Creation du champ password avec une taille maxi de 30 caracteres et crypté password= new TextField("Password", "", 30,TextField.PASSWORD); //Creation de la zone avec la possibilité de selectionner un seul fruit cg= new ChoiceGroup("Choisiez votre fruit",Choice.EXCLUSIVE,new String [] {"Mango","Orange","Tomato"},null ); //creation d'un bouton Ok pour valider le programme commandok= new Command("Ok", Command.OK,1); //creation d'un bouton Exit pour sortir du programme commandexit= new Command("Exit", Command.EXIT,2); //ici on fait appel au diferent fonction form.append(login); form.append(password); form.addCommand(commandok); form.addCommand(commandexit); //ici on va faire appel à la liste de fruit form.append(cg); //paramettre tres important s'il n'est pas present les bontons ne //marcheront pas form.setCommandListener(this); } public void startApp() throws MIDletStateChangeException { display.setCurrent(form); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void commandAction(Command c, Displayable s) { //si on clique sur le bouton Exit if(c == commandexit){ //appel manuel à la fermeture destroyApp(false); //on demande au manager de refermer l'application notifyDestroyed(); } } }