Owl Teach Yourself Java in 24 Hours, Fifth Edition
HOME / FEEDBACK / ORDER THE BOOK / OTHER BOOKS / PREVIOUS HOUR / NEXT HOUR / THANKS
ROGERS CADENHEAD

Hour 13: Building a Simple User Interface

Online Interactive Learning Lab

How to create the ClockPanel class and use it in the ClockFrame application.

Hour 13 Quiz

Question 1. Which user compnent is used as a container to hold other components?

1.a. TupperWare

1.b. JPanel

1.c. Choice

You can add components to the panel, and then add the panel to another container such as a frame.

Question 2. Which of the following must be done first within a container?

2.a. Establish a layout manager

2.b. Add components

2.c. Doesn't matter

You must specify the layout manager before the components so you can add them in the correct way.

Question 3. What method determines how components are arranged within a container?

3.a. setLayout()

3.b. setLayoutManager()

3.c. setVisible()

The setLayout() method takes one argument: the layout manager object that has the job of deciding where components should be displayed.

Notes and Corrections

  • None.

Source Files

Reader Questions

  • None.

Activities

   
HOME / FEEDBACK / ORDER THE BOOK / OTHER BOOKS / PREVIOUS HOUR / NEXT HOUR / THANKS

Search terms used to find this page: Java programming, teach yourself, 24 hours, how to, learn, Sams, Macmillan, Java2, JDK1.5, Java 1.5, JDK 1.5, SDK1.5, Java 2 SDK 1.5, SDK 1.5, Java 2 version 1.5, J2SE 1.5, J2SE 5, Java 2 Standard Edition 1.5, Java 2 Standard Edition 5, Java 2 SDK, Java SDK, Rogers Cadenhead, tutorial, hands-on, source code, code, javac, java, appletviewer, help, learning, applet, application, Java Plug-in, plugin, Swing, GUI, interface, Java2D, IO, Java Web Start, games, novice, beginner, neophyte, rookie

Valid HTML 4.01!

Valid CSS!