This is the final version. It is still your responsibility to
check back here for any changes or updates.
A Sample Solution is available in the public/assignments/hw08ClassFiles
directory on the Sunpal server for this assignment.
Required reading:Savitch text Chapters 9 This exercise
should be done using only the material from Chapters 1 through
9, plus Chapters 11-14.
Due dates: Check the Announcements.
Note: You can do this and take an interview without turning in
the assignment, as long as it is before the turnin deadline (and
until the deadline is announced it is definitely before the deadline.)
Programming: You may work in teams of two students, but
once you form a team, you cannot change the team for this assignment.
You may work alone if you prefer.
Write a program with a Swing GUI interface that allows the user
to inspect file properties and delete files. The GUI has a text
field for the user to enter the file name. It answers the following
questions:
1. Does the file exits?
2. Is it readable? (Does it have read permission)
3. Is it writeable? (Does it have write permission)
There is a suitably labeled text field for each of these questions
and a button labeled "Test". When the "Test" button is clicked
each of the three text fields change so the answer their respective
question either "Yes" or "No".
There is also a button labeled "Delete". When the "Delete" button
is clicked, another window appears. If the text field for file
name contains the blank string, the window says the user gave
no file name. If the named file does not exists, the window simply
says it does not exist. Each of these windows has an "OK" button
that makes the window go away and leaves the main window on the
screen. If the named file exists, this second window says "Are
you sure you want to delete the file XXXX?" where XXXX is the
name of the file. This window has two buttons labeled "Yes" and
"No". If "Yes" is clicked, the file is deleted provided the file
can be deleted (has write permission); if "Yes" is clicked but
the file cannot be deleted, a window with a suitable message appears
(You design this third window, which is simple); if "No" is clicked,
nothing happens. In all case, this second window goes away when
a button is clicked and leaves only the main window on the screen.
Use inner class(es) to keep your file self-contained and turn
in this one self-contained file.
Last Update: Feb 28, 2003 (by Nakul
Verma)