Writing a Java applet that uses data from a file
  1. You may choose to design your own applet that reads file data from the web server host and uses it in an application. This should either use the StreamTokenizer class on both word and number token types, or otherwise make use of individual characters or tokens in the file. That is, it's not o.k. to just use a readLine method from something like the BufferedReader class to display the contents of the file without a significant computation or display of individual data items from the file.
  2. or try the following applet:

  3.  

     

    Books/Authors Search

    This applet will make use of data from some files containing book titles and authors. These files actually came from the coreJava CD: Books.txt, Authors.txt, and BooksAuthors.txt, where the last file connects an author to each book by relating the author id to the book ISBN number. For this assignment, we can just ignore the publisher information (but if you really want it, there is also a file of publishers: Publishers.txt,

    The applet should reads the contents of the file into a set of arrays, Then there should be an interface where either the user can search for books, either by typing in a key word which your applet uses to search for in a title, or by typing in an author last name, which your applet uses to search for. (You don't have to implement both, just one.) Then the applet should display all the books that match the search.

    Now in reading the files into a set of arrays, you can set it up in various ways using streams. Also, you may wish to delete the first two lines of each file which describe the file structure or make other edits on the files to make your Java code easier. Here are two suggestions:

    Please document and submit your programs with a description as usual.