go to previous page   go to home page   go to next page


Yes. Be careful to include the "J" in JFrame or you will get an older AWT component.


Graphical components must be placed inside a container. A container corresponds to a rectangular area of the monitor screen, and the components it contains correspond to smaller areas within it.

In Java, a frame is a window that has nice borders, various buttons along the top border, and other features. What you usually call a "window" Java calls a "frame". A frame is a container object, so GUI components can be placed in it.

Like all software objects, a frame object is actually a section of main memory that holds information and methods. With the help of the operating system and the graphics board, Java paints a picture on the computer monitor that represents the frame. People often speak as if the frame were the actual picture on the monitor. In fact, what you see on the monitor is just a graphical representation of the frame.

GUI application programs are usually organized around one or more frames.


(Review: ) How do you import all the classes in the java.awt package and the javax.swing package?