September 2005
Beginner
576 pages
13h 6m
English
| Q1: | How are components arranged if I don't assign a layout manager to a container? |
| A1: | 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. |
| Q2: | Why does the time in the ClockFrame program never change? |
| A2: | 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. ... |
Read now
Unlock full access