|
Project Information
Members
Featured
Downloads
Wiki pages
|
Author:stevpan@gmail.com XFileDialog is a Java wrapper class built upon Windows CFileDialog/IFileDialog and JNI. With xfiledialog, a Java Swing app can easily access several frequently-used functions of Windows native Filedialog (multi-selection, thumbnail view-mode, folder-selection). On other platforms (MAC, LINUX) or DLL loading failure, XFileDialog will switch back to JFileChooser automatically. Stable: 0.63 http://xfiledialog.googlecode.com/files/xfiledialog0.63.zip The native C code was compiled with Visual C++ 2008. XFileDialog is based on XP's CFileDialog and Vista's IFileDialog (Common Item Dialog). Changelog:Ver. 0.63
e.g. setMode(), getFilters(), setMultipleEnabled()
addFilters(), resetFilters(). See details in the sample "helloworld.java" What you can get from xfiledialog under Windows
I shortened my Java program's startup time about 0.8 second by replacing JFileChooser with xfiledialog (Two customized JFileChoosers were initialized during startup in my old code). It's more convenient and efficient than calling SWT filedialog from Swing. Some other features
Interface:To select multiple files, three new methods were added: * void addFilters(ExtensionsFilter... filter);
Note: details can be found in helloworld.java
* void resetFilters();
* String[] getFiles();
Return: relative filenames
Note: You can call getDirectory() to get the current directory and create your File objects.
To select folders, two new methods were added: * String getFolder();
Return: absolute (full) path name
* String[] getFolders();
Return: absolute (full) path names
To set Thumbnail List as the default view mode for graphic apps * void setThumbnail(boolean val);
Note: val=true will force the native Windows dialog to thumbnail view mode.
val=false does not mean to disasble the thumbnail viewmode. It will let the
filedilog determine its view mode. In Vista, the filedialog can remember the
view mode of your last visit.
To turn off debug info (val=0) * void setTraceLevel(int val); On Cancel It will return NULL. How to use itHow to use xfiledialog : http://code.google.com/p/xfiledialog/wiki/how_to_use_xfiledialog How to compile xfiledialog: http://code.google.com/p/xfiledialog/wiki/How_to_compile_xfiledialog How to use xfiledialog in applet: http://code.google.com/p/xfiledialog/wiki/How_to_use_xfiledialog_in_applet Usage:
WhySeveral serious restrictions of Java/Swing prevent Java from being adopted in modern Windows desktop apps. A well-known restriction is Java's File dialog. Both of the two default filedialog classes in Java/Swing have serious limitations:
IMHO, a native Windows FileDialog that supports multi-selection and thumbnail preview mode is definitely required for desktop apps, especially graphic apps. Implementation and Credits:Read the this page if you wish to modify the code and recompile it yourself. http://code.google.com/p/xfiledialog/wiki/The_implementation_of_XFileDialog contributions: ExtensionsFilter in XFileDialog and WinXP/X64 testing were done by Jose Getino. Software projects which use xfiledialogMaple slideshow builder: http://sites.google.com/site/jtvmaker/ Email me if you know some projects using xfiledialog. Donation or Help:
Donation Link: https://sites.google.com/site/jtvmaker/Home/xfiledialog-online-demo
Maple Java slideshow builder: http://sites.google.com/site/jtvmaker/
Email me if you wish to help. stevpan@gmail.com |