File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Jfilechooser saving files with file extension Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Jfilechooser saving files with file extension" Watch "Jfilechooser saving files with file extension" New topic
Author

Jfilechooser saving files with file extension

Prasath Nadarajah
Greenhorn

Joined: Sep 18, 2010
Posts: 18
Hi,
i want to save XML files using Jfilechooser.
i want my jfilechooser to save all files with .xml extension only (not even .text extension)
and also to open only ".xml" files
how can i do that?


How can i modify the following code??

Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4952
    
    8

Read the API for JFileChooser and follow the link to the tutorial on "How to Use File Choosers" where you will find a section on "Filtering the list of files"

Also, take a look at javax.swing.filechooser.FileNameExtensionFilter.


luck, db
There are no new questions, but there may be new answers.
 
Don't get me started about those stupid light bulbs.
 
subject: Jfilechooser saving files with file extension
 
It's not a secret anymore!