Validated by Amaya

Richard G Baldwin (512) 223-4758, NRG Room 4238, Baldwin@DickBaldwin.com, http://www.austincc.edu/baldwin

INEW 2338 Advanced Java Programming

Assignment 4 - Swing - Chapter 5

Revised 01/09/10 for Amaya compatibility

The files that you deliver for this assignment must include a controlling class file named Asg04.class plus all of the source code files that you compiled to produce your class files.

Click here for general requirements regarding all programming assignments.

Click here to download a zip file containing a sample version of this assignment.  Your application must replicate the look, feel, and behavior of this sample except that your name must be included in the output of your version of the application where indicated.

Before you start to write this assignment, you should study the study guide entitled Swing.

Write the Java application described below.

The name of the controlling class for this application must be Asg04.java.  This application is a simple web browser with a hard-coded target URL.

The program begins with a JFrame on the screen. The size of the frame is 400 pixels wide by 480 pixels high. Your name must appear in the banner at the top of the frame.

The frame contains a scrollable pane as shown in Figure 1. The scrollable pane contains a properly-rendered version of the file named page1.html, which is located at the following URL: http://www.austincc.edu/baldwin/page1.html.

(Note:  Your instructor may elect to store the file on a different server with a different URL.  If so, your instructor will provide the correct URL for you to use.)

The term properly rendered means that the output produced by your program will be very similar to, but not necessarily identical to, the view of the file that you see if you point your favorite browser to the same URL.

In other words, your program connects to the server at the specified URL, downloads the file, and renders the html file in the scrollable pane.  Your output should be very similar to that shown in Figure 1.

Generally, the rendering of the file named page1.html exposes the following:

When you click on the hyperlink near the top of the page, a second file named page2.html is displayed as shown in Figure 2.  This exposes the following:

The URL for the second page is:   http://www.austincc.edu/baldwin/page2.html.

(Once again, your instructor may elect to store the file on a different server with a different URL.  If so, your instructor will provide the correct URL for you to use.)

When you click on the hyperlink on the second page, the first page is once again displayed in the scrollable pane.  You can ping-pong back and forth between the two files by clicking on the hyperlinks.

When you click on the close button in the upper right-hand corner of the frame, the program terminates and control is returned to the operating system.

If you need to know the details of the html text contained in the two files, you can view the html source using your regular browser.


Figure 1 Screen display on startup.


Figure 2 Screen display after clicking the link to go to page 2.
 

-end-

File:  Asg04.htm