home *** CD-ROM | disk | FTP | other *** search
- import java.applet.*;
- import java.io.*;
- import java.net.*;
-
- public class planner extends Applet {
- public void init() {
- try {
- /* First, open the document via http. */
- URL info = new URL( getDocumentBase() , "specs.dat" );
-
- /* Then open the input stream. */
- InputStream din = info.openStream();
-
- /* From here we can treat din just like anyother
- InputStream. For example, the following code parses
- the text as numbers and perform some operation
- on them: */
-
- StreamTokenizer st = new StreamTokenizer(din);
-
- while (st.nextToken() != StreamTokenizer.TT_EOF)
- performOp( st.nval );
- } catch (Exception ex) {
- System.out.println(ex.toString());
- }
- }
-
- private void performOp(double value)
- {
- System.out.println(value);
- }
- }
-