Java Reference
In-Depth Information
You can print the source code for either the Rooms class or the Reservations
application using the Print button in TextPad's Standard toolbar. You can print
a copy of the Reservations application interface by pressing A LT + PRINT SCREEN
when the window is active, which saves an image of the current screen to the
Windows Clipboard (your keyboard may use a slightly different name for this
key). You then can paste the picture into a picture-editing program, such as
Paint, or into another program, such as Microsoft Word or Microsoft
PowerPoint, and then print the document.
Chapter Summary
In this chapter, you learned how to create a windowed application to enter
reservations for party rooms at a local restaurant. First, you learned to create and
implement an external class named Rooms and to construct an instance method
to initialize instance variables. You learned to write code to create a constructor
class method, as well as how to declare and construct an array using correct
notation to create an array of boolean values, all set to false to represent unoccu-
pied rooms. The Rooms class also included an instance method to book the
rooms.
You then learned how to develop a stand-alone Reservations application,
including the construction of components such as a Frame, Panels, TextAreas,
Labels, TextFields, a CheckboxGroup, and a Choice component. You learned to
use a layout manager to place components precisely within the Frame and use
the main() method to set attributes of the Frame.
You learned how to use a counter-controlled loop, as well as how to correctly
use assignment and unary operators. You then learned how to code a for loop
using the increment operator, ++, to loop through the array of boolean values
for the state of each room and the array of TextFields that visually represented
the rooms on the screen.
You learned how to code the actionPerformed() method and a user-defined
method, clearFields(). You also learned how to retrieve data about the rooms and
clear fields. Finally, you learned how to save, test, and document the windowed
application.
Search WWH ::




Custom Search