Sams Teach Yourself Java 2 in 24 Hours

Sams Teach Yourself Java 2 in 24 Hours

By Rogers Cadenhead

Q&A

  1. How are components arranged if I don't assign a layout manager to a container?

    In a simple container such as a panel, components are arranged using FlowLayout by default—each component is added in the same manner that words are displayed on a page, from left to right until there is no more room, then on the next line down in the same manner. Frames, windows, and applets use the GridLayout default layout style you will learn about during the next hour.

  2. Why does the time in the ClockFrame program never change?

    The time that is displayed in a ClockPanel object is set up when the panel is created. For the date and time to change over a period of time, you need to call getTime() frequently and change what the panel displays each time. This involves some techniques you will learn during Hour 24, "Creating Animation."

Share ThisShare This

Informit Network