Given a component (comp) and a container (cont) that are organized according to a BorderLayout, which of the following should be used to add comp to the top of the container?
Given a component (comp) and a container (cont) that are organized according to a FlowLayout, which of the following should be used to add comp to the container?
Java uses layout managers to lay out components in a consistent manner across all windowing platforms. Because Java's layout managers aren't tied to absolute sizing and positioning, they are able to accommodate platform-specific differences among windowing systems. See the section “Working with Layout Managers.”
Without layout managers, Java programmers are faced with determining how their GUI will be displayed across multiple windowing systems and finding a common sizing and positioning that will work within the constraints imposed by each windowing system. See the section “Working with Layout Managers.”
The elements of a BorderLayout are organized at the borders (North, South, East, and West) and the center of a container. See the section “The BorderLayout Class.”
The elements of a GridBagLayout are organized according to a grid. However, the elements are of different sizes and might occupy more than one row or column of the grid. In addition, the rows and columns might have different sizes. See the section “The GridBagLayout Class.”
The preferred size of a component is the minimum component size that will allow the component to display normally. See the section “AWT Components” in Chapter 11, “The java.awt Package: Components and Facilities,” and “Using Layouts” in this chapter.