Question: This is a java programming assignment Assignment 1: Notepad Editor UI Objectives : Build a notepad editor. It will have a basic menu, functional menu

This is a java programming assignment

Assignment 1: Notepad Editor UI

Objectives: Build a notepad editor. It will have a basic menu, functional menu system that allows the user to control the appearance of the text in the editor box.

This is a java programming assignment Assignment 1: Notepad Editor UI Objectives:

Tasks Involved 1) Place a scroll pane and text area on the frame. You must start with a GridBagLayout:

Build a notepad editor. It will have a basic menu, functional menu

2) Set the properties: a) NotePadEditor Frame: title, resizable b) editorScrollPane : preferredSize, vewportView, gridx, gridy c) editorAreaText : font, lineWrap, wrapStyleWord

3) Add a menu system, as per the screenshots below:

system that allows the user to control the appearance of the textin the editor box. Tasks Involved 1) Place a scroll pane and

4) Name and accelerator keys for the menu bar:

3. Name and accelerator keys for the menu bar:

Text

Name

Accelerator

File

fileMenu

N/A

New

newMenuItem

-N

Open

openMenuItem

-O

Save

saveMenuItem

-S

Edit

editMenuItem

-E

Exit

exitMenuItem

None

Format

formatMenu

N/A

Bold

boldMenuItem (checkbox)

-B

Italic

italicMenuItem (checkbox)

-I

Size

sizeMenu

N/A

Small

smallMenuItem (RadioButton-sizeGroup)

-1

Medium

mediumMenuItem (RadioButton-sizeGroup)

-2

Large

largeMenuItem (RadioButton-sizeGroup)

-3

5) Add the listeners and their corresponding code for event methods depending on the selection of the corresponding menu items. Make sure to set the text area font and size routine based on the Format menu choices.

Goals To successfully complete this assessment and obtain all the marks, you must: a) Assure that Format menu works in accordance with the checkbox and radio buttons selection b) Assign an icon to the notePad frame. You may use the image of your choosing. c) Declare that window close button and exit menu option will let the application know when to close d) The window close listener must report something to the console before closing. e) Be able to compile and execute this code from the command line. You will be called upon to do so, so have your command prompt ready during your lab session. f) New must erase the contents of the text area. g) The load menu item must open a file chooser to allow the user to select one (and only one) .txt file. It should then load the text file and display its contents in the text area. h) The save menu item must use the file chooser system to permit the user to save the contents as a .txt file, with the name and location of their choosing.

Note Editor 1 File Format Fig 1: Note Editor on launch. gridx = 0 editor ScrollPane gridy - 0 Note Editor File Format Bold Ctrl-B Italic Ctrl-1 Size Small Ctrl-1 Medium Ctrl-2 Large Ctrl-3 Figure 2: Format menu and Size submenu open. - Note Editor File Format New Ctrl-N Open Ctrl-o Save Ctrl-s Edit Ctrl-E Exit Figure 3: File menu open

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!