Answer:

The program is an application. It is not called by a Web browser. It has a main() method where it starts running.

Running the GUI Program

Even though it does not do much, run this program and play with it. To run the program, first copy-paste-save the program to a file called TestFrame1.java. Then, in the command line window:

C:\> javac TestFrame1.java
C:\> java  TestFrame1
         
     program runs and displays the frame

The program displays a frame like the one here. While the program is running, you can click on the frame and drag it around, you can minimize it, you can grab a border and resize it, and so on. All of this is built into the JFrame class. Your program gets all of these features when it constructs a JFrame object.

empty frame

To stop the program, click on the "close button" (the little square that contains an X in the top right of the frame).

QUESTION 4:

What do you suppose this line from the program does?

JFrame frame = new JFrame("Test Frame 1");