• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jfilechooser saving files with file extension

 
Prasath Nadarajah
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic