Crea sito

import javax.microedition.midlet.MIDlet;

import javax.microedition.lcdui.*;

import java.io.*;

public class LeggiFile extends MIDlet {

public LeggiFile() {}

public void startApp() {

int c;

InputStream is = null;

try {

is = getClass().getResourceAsStream("/test.txt");

if (is != null) {

while ((c = is.read()) != -1) {

if (c == '\n')

System.out.println("");

else

System.out.print( (char)c );

}

is.close();

} else {

System.out.println("Errore nella lettura");

}

} catch (java.io.IOException ex) {

}

}

public void pauseApp() {}

public void destroyApp(boolean unconditional) {}

}