Java Reference
In-Depth Information
It can be difficult to get hold of a container whose contents fill it com-
pletely, because any attempt to select the container instead selects its
contents. To move a container obscured by its contents, select the con-
tainer from the form component tree, and then move your mouse over
the container but don't click it! A move handle icon appears above and
to the left of the component. Grab the handle with the mouse, and you
can move the entire container and its contents.
TIP
10.2.3
Setting component properties
You can configure each component and container in your interface by using
the Properties Inspector. This panel is used to configure and customize the
behavior and appearance of the components in your interface. You can find
properties automatically by IDEA through introspection; or properties can be
synthetic , meaning that you supply properties such as a preferred width and
height for a component.
Properties are explored in greater depth in section 10.4.
NOTE
Setting the values for each property is relatively straightforward, because each is
manipulated by controls appropriate for its type. For example, boolean properties
have a checkbox you use to set their value to true or false. If a property takes a lit-
eral text or numeric value, you can type the value into the field. IDEA validates
your input to ensure you don't assign text to a numeric value or vice versa.
Some values use a select box that restricts your selection to a few distinct
choices. For example, alignment properties allow you to choose from left, right,
and center alignments. In most cases, these selections correspond to numeric
constants in the Swing API ; you can determine their exact meaning by reading
the JavaDoc.
Values shown with several numbers in square brackets, such as margins and siz-
ing properties, are composed of a set of two or more distinct values. A compo-
nent's preferred size, for example, is expressed in terms of its height and width.
The value in brackets shows each of the component values and can't be edited
directly. To edit these values, you must expand the property to expose its subval-
ues, which you can edit directly.
The shaded properties listed at the top of the properties panel are specific
to the IDEA GUI Designer. They're used to control the layout, alignment, and
sizing of components. We discuss the use of these properties in detail later in
this chapter.
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search