Java Reference
In-Depth Information
An array of 16 employees is constructed and stored in a variable location
named empGroup. Again, think of the array as a stretched variable location; in
the case of an object array, each member of the array refers to a set of data as
opposed to a single data item. An object array of this type still follows the rule
about every array member being the same data type; in this example, every
member of the array is an Employee object. At compile time, the compiled
Employee object must exist for it to be used as a data type in the driver class.
Line 25 constructs a Book Room button that will display in the button panel
(line 24). Lines 28 through 32 construct Labels and TextFields for prompts and
data input that will display in the input panel (line 27).
Line 33 is the call to the constructor for the Choice component, which is
named numberOfGuests. The Choice() method has no arguments. Individual
items will be added to the drop-down list later in the program.
Finally, line 34 declares and constructs a CheckboxGroup named options,
and lines 35 through 37 construct three Checkbox components to display
within the CheckboxGroup. Recall that each Checkbox component in a
CheckboxGroup will appear as an option button on the program interface.
The following step enters the declarations for the Reservations class.
To Enter Declarations for the Reservations Class
1. Enter the code as shown in Figure 5-20.
The TextPad window displays the declarations for the Reservations class
(Figure 5-21).
call to
external class,
Rooms
new Colors
defined
roomPanel
components
buttonPanel
components
CheckboxGroup
inputPanel
components
individual
Checkboxes
FIGURE 5-21
 
Search WWH ::




Custom Search