EN 605.482 GUI Development with the Java Foundation Classes

Homework 6

 

In the final homework, you are given a sample data file HW6.csv, which contains the output of a spreadsheet document in comma-separated value (csv) format. Your task is to create a JTable which will display this data.

 

The original spreadsheet looked something like this:

A spreadsheet in this form may be saved out to a comma separated file with String values enclosed by quotes, and commas separating each field. Note that header values exist in the first row of the spreadsheet

Requirements for this Homework are as follows:

  1. Display the table in a JTable. The JTable will exist in a JScrollPane
  2. The JTable shall be in a JInternal Frame
  3. Each column will intially be 100 pixels wide
  4. Data in each column shall have an inset from the left edge of the column (indentation)
  5. There will be an area below the table which will allow the user to enable/disable viewing of each column in the table.
    1. This area will be in a JScrollPane
    2. Re-showing a column will have it appear in its original location in the table
  6. The default scrolling behavior for block increment in the vertical direction will be one row, in the horizontal direction it shall be 100 pixels.
  7. There will be a "done" button at the bottom of the screen which will close the window.
  8. Only by selecting the window close icon at the top left of the application JFrame, will the vm exit.
  9. The headers and content of the JTable will be dynamic, that is, they are a direct function of the content of the file loaded in. For this homework, HW6.csv is a test file, but your solution should be independent of the file loaded in. If HW6.csv is changed to have 20 data columns, your solution should work with no changes being required.

 

Hints: You have to be a bit clever when reading in the file HW6.csv. You will have to have two cases, one if it is a local file, the other if it is http. Check out the URL class for helpful methods for the http case.

The Grading Criteria for this Homework is as follows

Item
Points
Program Runs w/ no exceptions
45
JTable structure
20
Scrolling behavior
5
Selection of individual columns
10
Columns placed back in order
5
Cover Page Complete
5
Neatness/Presentation
5
Extra Effort
5