Lab 11

The following exercises are to be completed during lab class.  If you do not have time to finish during lab, they must be completed before the beginning of the following lab session.  You will turn in the lab gradesheet  at the beginning of the following lab.

Before beginning the exercises, copy this lab's folder from the T: drive to your H: drive.

  1. Complete exercise 9.6a on page 513 of your textbook.  This code will be written entirely in a main method.  Get the name of the file from the user by using JFileChooser.  Limit the file types to .txt files using Becker's FileExtensionFilter.java. Make no changes to FileExtensionFilter.java.   Refer to section 9.8.1 for this.  Call the file Upcase.java.  Include Upcase.java in your zip file for submission.
    Hint:  The String class might be really useful for this.
     
  2. Complete exercise 9.6d on page 513 of your textbook (also writen in main). Use JFileChooser again to get the name of the file, limiting the file types to .txt again.   Call your program Reverse.java . Include the Reverse.java file in your zip file for submisson.
    Hint: Check out Java's StringBuffer class.
     
  3. Complete exercise 9.12a on pages 515-516 of your textbook. Call your program SlideShow.java.
    To display your images you will need a file similar to the one on the t-drive called images.txt. Naturally the path and image names will depend on your images.
    Hints:
         Recall pg 96 shows code for setting up a JFrame.
         You will need a primming read (read the first image and set it in the JFrame before entering the loop to read the rest of the file).
    Include SlideShow.java, and ImageComponent.java in your zip file for submission. 
     
  4. Extra credit:   For parts 1 and 2, allow your user to enter the name and location of the new file using the JFileChooser save window. Make sure the extension on the saved file is always .txt. This should happen whether the user enters an extension or not and fixing the extension if they type something other than .txt at the end.
    Put a comment in your code saying that you completed the extra credit and also indicate it on your grade sheet (since this will simply change the files submitted for those exercises).
     

Use the windows zip utility to zip all required files into a single zip folder. Submit the single zip folder to your lab section under project #11 using Web Submit.

NOTE: Do NOT put your files into a folder to be zipped as this will make grading more complicated. Simply select the necessary .java files, right click, choose Send To = > Compressed (zipped) Folder.