if (done) { String code = doSolve(); String newurl = "http://localhost/?node=game&action=solove&code=" + code; try { getAppletContext().showDocument(new URL(newurl)); } catch (Exception ex) {} endGame(); } public String doSolve() { String file = "/java/file"; String test = "yyyyyy"; try { URL url = new URL(getDocumentBase(), file); BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); String code = in.readLine(); test = code; } catch (IOException e) {} return test; //System.out.println("string:" + code); }