COMP204-07B Assignment 3
Your task is to improve your Assignment 2 submission.
Add the following buttons to your application,
(or alternatively, add a menubar supplying the same funtionality):
- Reset Button: remove all points. This button should be disabled, when there are no points.
- Undo Button: remove the last added point; multiple undos will remove more and more points. When no point is left, the button should be disabled.
- Save Button: write all points to a text file. Use JFileChooser to select a file name. Define your format for the text file. It is ok to keep it very simple, e.g. one line per point listing x and y coordinates separated by a single space. This button should be disabled, when there are no points to save.
- Load Button: read in points from a text file. Again use JFileChooser to select a file name. The loaded points must be added to the current points, do not reset before loading.
- Quit Button: have an (annoying) modal dialog popup verifying that the user really wants to quit. Make "no" the default option.
Due date: Friday, 17th August
What to submit:
One java file containing all you code.
Document your code well.
Use the javadoc @author tag to give your name and ID!
Assessment will be slightly differently this time:
One point each for each of the five buttons specified, for a total of 5.
Here are a few hints:
- I'll discuss textual file IO on Thursday (August 9)
- A simple stack for keeping track of points should do the trick for "undoing" points.