Help: Read a file on another machine


Help is available for each task, or you can go straight to the solution source code.

Task 1

Add a text area and title (with the URL location) to the applet using BorderLayout. Open in input stream to the URL specified in the URL applet parameter list else open URLTest.java in the document directory; that is, create:
new URL(getDocumentBase(), "URLTest.java");
Use the provided method displayFile to display the contents.
Parameters from the HTML file can be retrieved with getParameter. Use method openStream on the URL to open an input stream from that URL and then attach a DataInputStream to read lines of input. Display the file with displayFile and then close it.

Copyright © 1996-1997 MageLang Institute. All Rights Reserved.