Thank you all, especially Dr. Parker, Ken and
Sandeep. With all of your advice, I was able to get the thing fixed. It was
actually a very simple problem, as Dr. Parker noted, I needed to somehow tell my
program to look on the server, not on the local PC.
This little bit of code is all it
took:
//Class variables
BufferedReader
in;
String inputLine; //one line of input from the file int inputIndex; //the position in the line of input
//Constructor
InputBuffer(String filename) { inputIndex = 0; //initialize variables inputLine = null; try { URL file = new URL("http://www.gregontheroad.com/AnnsApps/project/input/"+filename); in = new BufferedReader(new InputStreamReader(new BufferedInputStream(file.openStream()))); } catch(IOException ioe) { System.out.println("ERROR: Cannot open file " + filename); } I hardcoded the URL here, but if I were in the
applet class itself and not the InputBuffer class, I could have used
getDocumentBase() + filename
thanks everyone!
ann
|