Description
Create a text editor with a menu. The menu should be structured in the following way:
File
- New - selecting this item brings up a yes/no/cancel dialog asking the user to save
existing text if any text is present. Choosing Yes saves the text into "Editor.txt" and
clears the text area, choosing No clears the area without saving and choosing Cancel
results in no operation.
- Save - if text is present saves it into "Editor.txt" file.
- Exit - brings up a yes/no/cancel dialog asking the user to save existing text before
exiting if any text is present. Choosing Yes saves the text into "Editor.txt" and terminates
the application, choosing No terminates without saving and Choosing Cancel results in
no operation.
Edit
- Replace - brings up an input dialog with entry for searched text. Upon entering the text
and selecting OK another input dialog comes up with entry for replacing text. Once
entered, the replacing text will replace the searched text everywhere in the text area.
Help
- About - brings up an information dialog stating the version of the application.
For yes/no/cancel dialog use JOptionPane.showConfirmDialog(...) with
JOptionPane.YES_NO_CANCEL_OPTION.
This method returns an integer that can be either JOptionPane.YES_OPTION,
JOptionPane.NO_OPTION, or JOptionPane.CANCEL_OPTION
For input dialog use JOptionPane.showInputDialog(...)