Chapter 12. Chooser Dialogs


Just about every application you write these days needs to have a mechanism for opening and saving files. In the AWT, you can use the FileDialog class, but this is a heavyweight dialog that lacks the flexibility of the Swing components we've seen so far. The JFileChooser is Swing's answer to the FileDialog. The Swing package also contains a helper dialog for choosing colors (a common task during application configuration). We'll look at both of these dialogs in this chapter.

To get things started, Figure 12-1 shows the class hierarchy of the pieces we'll be looking at in this chapter.

Figure 12-1. Class diagram for JFileChooser and JColorChooser
figs/swng2.1201.gif


Java Swing
Graphic Java 2: Mastering the Jfc, By Geary, 3Rd Edition, Volume 2: Swing
ISBN: 0130796670
EAN: 2147483647
Year: 2001
Pages: 289
Authors: David Geary

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net