L'erreur java.lang.nullpointerexception n'est retournée

fillons Messages postés 13 Date d'inscription lundi 20 octobre 2008 Statut Membre Dernière intervention 23 octobre 2008 - 22 oct. 2008 à 13:27
fillons Messages postés 13 Date d'inscription lundi 20 octobre 2008 Statut Membre Dernière intervention 23 octobre 2008 - 23 oct. 2008 à 00:07
import java.io.IOException;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.Connector;
import javax.microedition.io.file.FileConnection;
import java.io.InputStream;
import java.io.InputStreamReader;


import java.io.*;


/**
 * @author USER
 */
public class fichier extends MIDlet implements CommandListener {
    private Display aff=null;
    private Form formul;
    private Command exit;
    private FileConnection fc;
    private InputStream _in;
    public fichier () throws IOException
    {
      


       aff=Display.getDisplay(this);
       exit=new Command("Exit", Command.EXIT, 1);
       formul=new Form("bonjour");
       formul.addCommand(exit);
       formul.setCommandListener(this);
       try {
            Connector.open("[file:///root1/essai.txt file:///root1/essai.txt]");
            //System.out.print(" FFFCC  " + fc.exists()+"  FFFCC ");
//fc.exists() me renvoie False c-à-d que le fichier n'existe pas :(
          if(fc.exists())
          {
            _in=fc.openInputStream();                      
          }
 fc.close();
 }
       catch (IOException e)
       {
    //e.printStackTrace();
          System.err.println("impossible d'ouvrir le fichier");
 }
  /*
  * Constructeur
  */
  }
    public void startApp()
    {
        aff.setCurrent(formul);
       
    }


    public void pauseApp() {
    }


    public void destroyApp(boolean unconditional) {
    }
    public void commandAction(Command c, Displayable s) {
        if(c==exit)
        {
        destroyApp(false);
        notifyDestroyed();
       }
 } 
}

22 réponses

coucou747 Messages postés 12303 Date d'inscription mardi 10 février 2004 Statut Membre Dernière intervention 30 juillet 2012 44
22 oct. 2008 à 19:29
ca j'y peux rien...
0
fillons Messages postés 13 Date d'inscription lundi 20 octobre 2008 Statut Membre Dernière intervention 23 octobre 2008
23 oct. 2008 à 00:07
Merci
0
Rejoignez-nous