Skip to Content
Java Foundation Classes in a Nutshell
book

Java Foundation Classes in a Nutshell

by David Flanagan
October 1999
Intermediate to advanced
754 pages
36h 7m
English
O'Reilly Media, Inc.
Content preview from Java Foundation Classes in a Nutshell
CHAPTER 27
Thejavax.swing.filechooser Package
The javax.swing .filechooser package defines auxiliary classes used by the javax.-
swing .JFileChooser component. You can customize the behavior of a JF ileChooser by
defining concrete subclasses of these abstract classes. Define a FileF ilter to specify
what files should be displayed by the JF ileChooser. Define a FileV iew to specify how
it should display those classes. And define a FileSystemV iew to specify how it should
traverse the file system. Figure 27-1 shows the class hierarchy of this package.
ABSTRACT CLASS
extends
KEY
CLASS
javax.swing.filechooser
java.lang
Object
FileFilter
FileSystemView
FileView
Figur e 27−1: The javax.swing.filechooser package
FileF ilter Ja va 1.2
javax.swing .filechooser
This abstract class defines the methods used by the JF ileChooser component to select a
subset of files for display. When the accept() method is passed a File object, it should
retur n tr ue if that file should be displayed by the JF ileChooser and false otherwise. accept()
often makes its determination based on the filename extension, but it can also take
other factors into account, such as the readability and writability of the file. The getDe-
scription() method must retur nahuman-r eadable description (preferably localized for
the current locale) of the filtering operation perfor med by the filter. For example, if a
javax.swing.
filechooser
551
14 September 1999 10:28
F
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

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Java 9 Programming By Example

Java 9 Programming By Example

Peter Verhas
Java 9 Regular Expressions

Java 9 Regular Expressions

Anubhava Srivastava

Publisher Resources

ISBN: 9780596805364