Java Reference
In-Depth Information
Exercises
12.1
Add a menu item 'Save as' to the first menu. When clicking it, a file selection
dialogue should appear where one can select a file or input a new name. The
text is then saved to this file.
12.2
Augment the 'Load' function as follows. If a file has already been loaded and
is displayed, a dialogue box appears. The user is asked whether the displayed
text should be saved before loading the new one. Depending on the user's
choice the old text is simply erased (using setText("") )orsaved and erased
before loading the new one.
12.3
Augment the 'Exit' function as follows. If 'Exit' is selected while a text is dis-
played, a dialogue appears. The user is asked whether the text should be
saved before exiting or not. Depending on the user's choice the appropriate
action is performed. This procedure should also be executed when the close
button to the frame is pressed.
12.4
Add another menu 'Help' to the editor. It should have two items 'Help' and
'About'. The first should display a help text in a dialogue window and the
second some information on the program.
12.5
Add a status bar under the editor pane which displays some additional infor-
mation, e.g. the number of lines or the file name.
Search WWH ::




Custom Search