JFileChooser Class
Package: javax.swing
The JFileChooser class lets you display standard Open and Save dialog boxes similar to the ones you’ve seen in other GUI applications. Figure 5-4 shows an Open dialog box created by JChooser.

Figure 5-4
The result returned by the showOpenDialog method indicates whether the user chose to open a file or click Cancel, and the JFileChooser class provides a handy getSelectedFile method that you can use to get a File object for the file selected by the user.
Fields
|
Field |
Description |
|
|
Returned by the |
|
|
Returned by the |
|
|
Returned by the |
|
|
Used by the |
|
|
Used by the |
|
|
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access