Assignment-03c

 

 

 

Foreword

Resources

Code Listings

Foil Sets

Assignments

Solutions

External Resources

SiteMap

Search

Home

Up ] Assignment-01a ] Assignment-01b ] Assignment-01c ] Assignment-01d ] Assignment-02 ] Assignment-02a ] Assignment-03 ] Assignment-03a ] Assignment-03b ] [ Assignment-03c ] Assignment-03d ] Assignment-04 ] Assignment-04a ] Assignment-04b ] Assignment-05 ] Assignment-06 ] Assignment-07 ]

This assignment involves advanced AWT components such as frames and menus. Briefly, your task is to implement two menus in an existing application. This application simulates a Netscape browser window.

Since applets can not access the underlying file system (for security reasons), a program that simulates Netscape Navigator must be written as a Java application. For the purposes of this assignment, however, we have written our Netscape simulator so that it runs as both an application and an applet. (The applet requires a Java 1.1-compatible browser.) Thus you may use appletviewer to debug your assignment or execute the bytecodes at the command line, whichever you prefer.

Only three menus have been implemented in our simulator: the File menu, the Options menu, and the Help menu. Of these three, only the File menu has any working commands whatsoever (New and Exit).

  1. Install the source code for the Netscape look-alike Netscape.java in your homework directory. Be sure to install a corresponding HTML file. The following simple HTML document should be sufficient:
      <HTML>
      <BODY BGCOLOR=white>
      <APPLET CODE="Netscape.class" WIDTH=200 HEIGHT=100></APPLET><P>
      <A HREF="Netscape.java">Netscape.java</A>
      </BODY>
      </HTML>         
  2. Compile Netscape.java and test it with appletviewer. Also test it at the command line.
  3. Implement both the Edit menu and the View menu in Netscape.java. Your menus should mimic the corresponding menus in Netscape Navigator 3.0. Be sure to include keyboard shortcuts in your menus.
  4. Submit your assignment by putting links to Netscape.html and Netscape.java (and any other source files) on your homework page.
  5. Extra Credit: Implement a command of your own choosing.