8.9.2. A Complete Example for JavaBeans Persistence

We’ll end the description of JavaBeans persistence with a complete example (see Figure 8.15). This application writes a damage report for a rental car. The rental car agent enters the rental record, selects the car type, uses the mouse to click on damaged areas on the car, and saves the report. The application can also load existing damage reports. Listing 8.10 contains the code for the program.


Figure 8.15. The DamageReporter application

The application uses JavaBeans persistence to save and load DamageReport objects (see Listing 8.11). It illustrates the following aspects of the persistence ...

Get Core Java® Volume II—Advanced Features, Ninth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.