Java Reference
In-Depth Information
Don't worry that the third label is so close to the Exit button. VE displays the frame according to the property
values specified in the initialization method. The Exit button's location will be reset to the lower-right-hand corner
of the frame in the constructor.
Now we'll test to see if the new labels are long enough.
15.
Close the Customize Layout window.
16.
Run EmployeeApp.
The zip text almost fits in the labels. Should we resize the labels again?
Enid is only a four-letter city. What if we tried to display Jacksonville? It probably would not fit. So really we need
to decrease the font size—but by how much? Usually, a programmer would determine the largest value that must fit in
the label and use that value to select the correct font size.
17.
In the Design view of EmployeeFrame, click the cSZLbl label to select it and then click the
label again.
An input text box will be displayed where new label text can be specified.
18.
Enter “Jacksonville, FL 32246” (as seen in Figure 4-17 ) and press Enter.
Figure 4-17.
Because none of the zip code can fit in the label, we will change the font size. This time instead of selecting a size,
we will specify a size.
19.
Select all three labels, display the Java Property Editor for the font property, and in the Size
field type 26 over the current value of 36.
Notice that sizes not listed can be specified. This is not true for all properties. For example, for Name and Style
you can only choose among the listed options.
20.
In the Name field, replace Dialog with Sims and hit the OK button.
 
Search WWH ::




Custom Search