Sun Java Solaris Communities My SDN Account Join SDN
 
Tutorials & Code Camps

Menus

 

Training Index

by jGuru

Help  API Docs  About This Short Course  Short Course  Exercises

Given an application (or applet) that constructs a Frame instance and sets up a "File" menu, create a "Help" menu that uses MenuItem objects.

Skeleton Code

Tasks

1. Create class HelpMenu as a subclass of Menu (mimic FileMenu). Add the following menu items:
    Fundamentals
    Advanced
    - (a separator)
    Have Read The Manual    (CheckboxMenuItem)
    Have Read The Tutorial  (CheckboxMenuItem)
    Misc (submenu)

where the Misc submenu has:

    Help!!!
    Why did that happen?
2.

Define the actionPerformed() so that menu item selections are displayed in the supplied text area (mimic the FileMenu).

Where help exists, the task numbers above are linked to the step-by-step help page.

Solution Source

Demonstration

This exercise only runs within browsers that support the Java Runtime Environment 1.1 and appletviewer. If you are using an appropriate browser, try this exercise. The output should look similar to the following:

MENUTEST.GIF

Exercises

Short Course

Copyright 1996-2000 jGuru.com. All Rights Reserved.