File choosers provide a GUI for navigating the file system, and then either choosing a file or directory from a list or entering a file name or directory name. To display a file chooser, you can either add an instance of JFileChooser to a container, or use the JFileChooser API to show a modaldialog that contains a file chooser. File choosers often appear within modal dialogs because file operations can be sensitive to changes within a program.
A JFileChooser object only presents the GUI for choosing files. Your program is responsible for doing something with the chosen file, such as opening or saving it.
The following program display a simple JFileChooser in Java Swing.
C:\>jdk1.4\bin>javac JFileChooserDemo.java
C:\>jdk1.4\bin>java JFileChooserDemo
|
"Output of JFileChooserDemo.class" |
|
Download Complete Program
|
Java Swing-II
JFileChooser in Java method have easy understood me. Thanks..
ReplyDeleteJava Training in Chennai