Java Reference
In-Depth Information
Figure 19.23
Viewing the Movie bean and two JButton beans in preview mode.
Click the Rent button while in preview mode, then change back to design
view by selecting View, Design View on the main menu again. Click the Movie
bean and view all of its properties. The read-only property rented should be
checked, as shown in Figure 19.24. You should also be able to see the output in
the command prompt window that the Bean Builder is running in because the
Movie bean contained several calls to System.out.println() to show when the
various methods of the bean are invoked.
Similarly, clicking the Return button in the preview mode causes the movie
to no longer be rented and resets the customerName property to an empty
String.
Now that I have shown you how to hook two beans together, let's go
through an example of writing your own events, which is an important aspect
of JavaBean programming.
Figure 19.24
The Movie is now rented when the Rent button is clicked.
Search WWH ::




Custom Search