COP 4331 (5862/99S)
Assignment 5: Java Window Application
Modify SLOTE as a Java Application
Modify your implementation of SLOTE (Assignment 4) to operate as
a windowed application and add the following features.
-
Modify SLOTE to run in a frame as an application
-
Add / modify your code to support operation as a frame
-
Add an "exit" command
-
Modify the program to load and save files it edits
-
If there is an argument on the command line, it is the name of a file to
open and edit
-
Add the operations
-
open -- uses a file dialog to select the file to open
-
save -- saves the file being edited; use a file dialog to select
the path for saving the file
-
If you exit without saving, the changes will be lost
-
If you attempt to open a file that does not exist, pop up a dialog with
an error message and block the application until the user clicks the OK
button on the dialog
In a comment at the top of the file containing the class Slote, place a
comment that clearly states the version of Java, 1.1 or 1.2 that you are
using. All programs will be tested using java1.1 or java1.2 on the
CSE Sun Unix servers, so be sure your program runs in that environment.
A sample of code to convert an applet to run as an application (modified
from TYJ 1.1) can be viewed here.
Teams
You may work on this with a partner or individually. If you work
with a partner the following conditions apply.
-
Allow visual editing of the text. To do this, modify your program
as follows.
-
The text area is to contain the full text of the document and is to be
editable. No line numbers are displayed here, just the text of the
document.
-
When a list or search command is executed, pop up a dialog with the result
of the command. The text should be read-only. The dialog should
not be modal and should continue to be displayed until the user clicks
an OK button
-
submit a single copy of your work with both names on it.
What to submit
-
Source code for your Java classes
-
A printout or drawing showing your user interface
-
Submit your java source code files with hwroy
-
Place the application file Slote.class in your directory ~/public_html/cop4331/slotewin/.
Other class files must be located so that the application can be run from
this location. Make sure the permissions on the directories and the
files are correctly set as described on the
course home page.
Last Update: 6 Apr 1999 by R.Levow