Sams Teach Yourself Java 2 in 24 Hours

Sams Teach Yourself Java 2 in 24 Hours

By Rogers Cadenhead

Quiz

To see whether your brain cells are laid out properly, test your Java layout management skills by answering the following questions.

Questions

  1. What container is often used when subdividing an interface into different layout managers?
    1. JWindow
    2. JPanel
    3. Container
  2. What is the default layout manager for a panel?
    1. FlowLayout
    2. GridLayout
    3. There is no default
  3. The BorderLayout class gets its name from where?
    1. The border of each component
    2. The way components are organized along the borders of a container
    3. Sheer capriciousness on the part of Java's developers

Answers

  1. b. JPanel.
  2. a. Panels use flow layout, but the default manager for frames, windows, and an applet window is grid layout.
  3. b. The border position of components must be specified as they are added to a container with the use of directional variables such as BorderLayout.WEST and BorderLayout.EAST.

Share ThisShare This

Informit Network