Java Reference
In-Depth Information
Quiz
Review today's material by taking this three-question quiz.
Questions
1. What is the default layout manager for a panel in Java?
a. None
b. BorderLayout
c. FlowLayout
2. Which layout manager uses a compass direction or a reference to the center when
adding a component to a container?
a. BorderLayout
b. MapLayout
c. FlowLayout
3. If you want a grid layout in which a component can take up more than one cell of
the grid, which layout should you use?
a. GridLayout
b. GridBagLayout
c. None; it isn't possible to do that.
11
Answers
1. c.
2. a.
3. b.
Certification Practice
The following question is the kind of thing you could expect to be asked on a Java pro-
gramming certification test. Answer it without looking at today's material or using the
Java compiler to test the code.
Given:
import java.awt.*;
import javax.swing.*;
public class ThreeButtons extends JFrame {
public ThreeButtons() {
super(“Program”);
 
Search WWH ::




Custom Search