A simple Notepad application built using Java Swing, featuring basic text editing capabilities, file handling, formatting options, and undo/redo functionality.
-
File Management:
- Create a new file
- Open existing files
- Save current content to a file
- Save as a new file
- Exit
-
Text Formatting:
- Choose from different font types: Arial, CSMS, TNR
- Adjust font size (8, 12, 16, 20, 24, 28)
- Enable/disable word wrapping
-
Color Customization:
- Change text color to White, Black, or Blue
-
Edit Functions:
- Undo and Redo operations for text changes
The keyHandler
class manages specific keyboard shortcuts for the GUI application. Here are the key combinations and their actions:
-
Control + S (Save)
- This shortcut saves the current file. When pressed, it triggers the save functionality of the application.
-
Shift + Control + S (Save As)
- This combination opens a dialog for saving the current file with a new name or location. It allows users to specify where to save the file.
-
Alt + F (Open File Menu)
- Pressing
Alt
andF
together simulates a click on the File menu. This opens the file-related options like New, Open, Save, and Exit.
- Pressing
These keyboard shortcuts enhance user experience by providing quick access to common file operations without needing to navigate through menus.