|
Description
|
A DESCRIPTION OF THE REQUEST :
On nearly all platforms, JFileChoosers are a poor substitute for native file dialogs. They do not look very much like native file dialogs, and they have far less functionality. On Windows, for example, they offer many more views than a JFileChooser does, allow you to view the Properties window for a file, allow you to open a file in a selected application, display previews of images, and so on. They also have better handling of shortcuts, better handling of networked drives, etc. It is unlikely that JFileChooser will ever reproduce all of this functionality. For these reasons, many programs that otherwise are entirely Swing based still use FileDialog instead of JFileChooser.
On the other hand, JFileChooser offers some important features that are not available in FileDialog: a "select folder" mode, multiple file selection, filtering of files, the ability to embed a custom component, etc.
Some of these features would be difficult or impossible to implement, since native file dialogs do not provide the proper support. Others, however, are well supported by native file dialogs on all platforms, and there is no reason not to add them to FileDialog.
At the very least, FileDialog should be enhanced to offer:
1. A "select folder" mode
2. Multiple file selection
It also would be very nice to add
3. Some mechanism for filtering files
FileDialog already allows you to set a FilenameFilter, but it is ignored on most platforms, since it is incompatible with the way native file dialogs filter files. Native file dialogs do provide filtering mechanisms, however, and it would be nice if FileDialog could make use of them.
JUSTIFICATION :
FileDialog is widely used due to its many advantages over JFileChooser, and that will remain true for the foreseeable future. It therefore should be enhanced to add useful features wherever possible. It will probably never reproduce all the features of JFileChooser, but similarly, JFileChooser will never reproduce all the features of FileDialog. Both of them should be actively supported and updated.
xxxxx@xxxxx 2004-11-09 19:13: customer GMT
|
|
Comments
|
Submitted On 27-MAY-2006
MiguelM
Here's a suggestion for how to support file filtering in class FileDialog in a platform-independent manner:
1) Add a method like this:
boolean isFilenameFilterSupported
2) Since some platforms don't support filename filters, but do support extension filters, I suggest these methods:
boolean isExtensionFilterSupported()
void setExtensionFilter(String[] validExtensions);
This way, you could support Extension filters in all platforms that either support it directly (Windows) or that support FilenameFilters.
3) Add similar methods for other filter mechanisms that may exist on other platforms.
Submitted On 21-AUG-2007
uckelman
Most native file choosers support multiple file selection these days. It's maddening that AWT doesn't expose this support.
Submitted On 09-MAR-2009
xmlizer
"Multiple file selection" is definitely a must have feature
Submitted On 19-AUG-2009
rednoah42
Add support for directory selection and multiple selection mode. People want a native file dialog, doesn't matter if the application itself looks native or not.
Submitted On 28-AUG-2009
stevpan
Multiple selection mode is definitely necessary for desktop java apps. The JFilechooser does not have preview mode. Now I had to use swt+ dj-swing to get a native filedialog for multiple selection. However, It causes many issues in my program.
Submitted On 09-OCT-2009
Greg_Kellum
I'm working on a Swing application and we definitely need multiple file selection, but we want to keep the look and feel of a native file dialog.
Submitted On 13-JAN-2010
stevpan
If you only use Windows, you can call the native windows filedialog: CFileDialog with JNI It's not a good solution, however, it may be useful for some java desktop apps.
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|