Question
In this project you will create a simple text editor. . This application will allow you to create new text files and open existing text
In this project you will create a simple text editor.
. This application will allow you to create new text files and open existing text files.
The file contents are to be displayed in a TextArea text area.
The application will have menu items to change the font and style of the text that is displayed in the text area.
Line wrapping is turned on, using word wrap style, and the text area is in a scroll pane.
The applications window will display as shown:
This application uses a menu system to perform the following operations and will be displayed as shown:
Notice the items that have a letter underlined; these are hot keys.
Each menu item generates an action event that is handled by an action listener.
The following presents a summary of the actions performed by each menu item:
File Menu: New This menu item clears any text that is stored in the text area.
In addition, the class's file name field is set to null .
The filename field contains the path and name of the file that is currently displayed in the text area.
Open This menu item displays a file chooser that allows the user to select a file , from any directory, to open.
If the user selects a file, it is opened and its contents are displayed in the text area.
The path and name of the file are stored in the filename field.
Save This menu item saves the contents of the text area.
The contents are saved to the file with the name and path stored in the filename field.
If the filename field is set to null , which would indicate that the file has not been saved yet,
then this menu item performs the same action as the Save As menu item.
Save As This menu item displays a file chooser that allows the user to select a location and file name.
The contents of the text area are written to the selected file, and the path and file name are stored in the file name field.
(Be careful when using this menu item. As it will not warn you when you are about to overwrite an existing file)
Exit this menu item ends the application.
Font Menu: Monospaced This radio button menu item changes the text area's font to Monospaced.
Serif This radio button menu item changes the text area's font to Serif.
SansSerif This radio button menu item changes the text area's font to SansSerif.
Italic This check box menu item changes the text area's style to italic.
Bold This check box item changes the text area's style to bold.
You will need to use the API's Font class for the fonts and styles in the Font menu.
Look in the TextArea class in the javafx package API for the way to set word wrap to on.
Set the text area to display 20 lines and 40 characters per line.
Use JavaFX to produce this program. Download and install SceneBuilder to produce your program.
There should be just three files that you do:
TextEditorController.java
TextEditor.java
TextEditor.fxm
//The have Image how the are look
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started