Hi, I've written an applet which searches through a txt file, but I am having problems when running the applet through a web browser. I now understand (thanks to Alex) that I must use the URL.class and access the txt file as a resource, but I'm not sure how I should go about this. I can set the URL as follows (I'll change the path when needed): URL url = new URL(getCodeBase(), "C honeList.txt"); ...but I'm not sure what to do next. This provides the URL for the txt file but how do I access it and can I do so as a txt file? Is it possible to still use the FileReader class? TIA Jon
the documentation for java.net.URL says that one can use the method openStream() to get an InputStream to read the contents from. Obviously you can't use FileReader on an InputStream, but you can use InputStreamReader, which is the parent class of FileReader. You need to move your phone list file to where the web server can get to it, and I doubt that C:\ is one of those places.