import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import java.io.*; public class Guess extends MIDlet { private InputStream is; private InputStreamReader isr; public static Display display=Display.getDisplay(this); private Form testForm=new Form("This is a test"); public void startApp() { try{ is=getClass().getResourceAsStream("/test.txt"); isr=new InputStreamReader(is,"UTF-8"); String size=Integer.toString(is.available()); testForm.append("Size:\n"+size); display.setCurrent(testForm); isr.close(); is.close(); }catch(IOException exc) { crash("Loading file text.txt\n"+exc); } } public void pauseApp() { } public void destroyApp(boolean unconditional) { } //умираем public void crash(String err){ Form errorForm=new Form("Oшибoчкa вышлa"); errorForm.append(err); display.setCurrent(errorForm); } }