aspose 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 JavaScript Promises Essentials this week in the JavaScript 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: 4658
    
    5

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jfilechooser saving files with file extension