import javax.microedition.lcdui.*; import javax.microedition.midlet.*; import javax.microedition.io.*; import java.io.*; public class Raamatukogu extends MIDlet { TextBox t1; public Raamatukogu(){ try{ String aadress="http://localhost:8080/servlets-examples/servlet/Baasilooja5"; InputStream sisse=Connector.openInputStream(aadress); ByteArrayOutputStream baos=new ByteArrayOutputStream(); int arv=sisse.read(); while(arv!=-1){ baos.write(arv); arv=sisse.read(); } byte[] b=baos.toByteArray(); String tekst=new String(b); t1=new TextBox("Andmed", tekst, tekst.length(), TextField.ANY); Display.getDisplay(this).setCurrent(t1); }catch(Exception e){ e.printStackTrace(); } } protected void startApp( ) throws MIDletStateChangeException{} protected void pauseApp( ){} protected void destroyApp( boolean p1 ) throws MIDletStateChangeException{} }