Tutorial Tutorial Step 04

Step 3: Create the menus

Let's create the menu structure we want, which will be as follows:

TextEdit UI TextEdit UI TextEdit UI

  1. Click the Design tab, if it's not already selected.
  2. Double click menuBar1 in the Component Tree to bring up the Menu Designer. (Double-clicking on any item in the Component Tree opens the designer associated with it.)
  3. Select the File menu in the Menu Designer.
  4. Press the down-arrow key to select the Exit menu item.
  5. Press the Insert key, or click the Insert button on the toolbar.
  6. Type New.
  7. Press the down-arrow (selecting the Exit menu item again).
  8. Press the Ins key again.
  9. Type Open.
  10. Similarly, add menu items for Save and Save As.
  11. Insert a separator above File|Exit by selecting the Exit item, then clicking the Separator button on the Menu Designer's toolbar.
  12. Select the Help menu and click the Insert button to insert a new menu between the File and Help menus.
  13. Click the highlighted area at the top of the new menu and type Edit.
  14. Press Enter to move down to the next blank entry. You don't need to press Insert here because there are no menu items on this menu after the current entry.
    Note: If you need to delete an entry, select it then press Delete twice. The first delete removes the text from the menu item, the second deletes the menu item itself.
  15. Continue to build the Edit menu as indicated above. If an entry is too wide for the edit area, it will automatically scroll as you type. When you press Enter, the Menu Designer will adjust the width of the menu to accommodate the longest item in the list.
  16. Close the Menu Designer by double-clicking on any component in the UI section of the Component Tree, like bevelPanel1, or textArea1. This switches the view in the Content pane back to the UI Designer.

Save the file, then run the application again at this point. You should be able to play with the UI and type text in the TextArea, but the buttons won't do anything yet, and only the File|Exit menu will work.

Your application should look like this when running:

TextEdit UI

Tutorial Tutorial Step 04