Re: Choosing specific file in JFileChooser
- From: "danharrisandrews@xxxxxxxxx" <danharrisandrews@xxxxxxxxx>
- Date: 30 Aug 2006 12:21:17 -0700
Great answer Andrew. Dushkin, you may also want to have a look at the
JFileChooser object's method called "setAcceptAllFileFilterUsed" to
eliminate the "*.*" all files. A couple of other points you may want to
look at are:
(1) setFileSelectionMode(JFileChooser.FILES_ONLY)
and (2) when implementing the FileFilter return true if the
pathname.isDirectory() || equals pathname.getPath().equals("win.ini").
Cheers,
Dan Andrews
- - - - - - - - - - - - - - - - - - - - - - - -
Ansir Development Limited www.ansir.ca
- - - - - - - - - - - - - - - - - - - - - - - -
Andrew Thompson wrote:
dushkin wrote:
..
I need to allow the selection of only specific file name from a..
JFileChooser dialog.
For example, I want to let the user choose only "win.ini" file
The JavaDocs for JFileChooser show a small example
of using FileFilter.
Andrew T.
.
- References:
- Choosing specific file in JFileChooser
- From: dushkin
- Re: Choosing specific file in JFileChooser
- From: Andrew Thompson
- Choosing specific file in JFileChooser
- Prev by Date: Re: Problem with setUndecorated() method in JFrame
- Next by Date: Re: JScrollPane & the scroll speed ?
- Previous by thread: Re: Choosing specific file in JFileChooser
- Next by thread: Re: Choosing specific file in JFileChooser
- Index(es):