• Post Reply Bookmark Topic Watch Topic
  • New Topic

FileFilter  RSS feed

 
kumar mars
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai
i am using a filechooser with file filter for save dialog
we can get the name of the file by getSelectedFile() method
how can we get the file filter that the user has selected.
suppose i have file filters for type .java and .txt
if user types a name as "tfile" ans type of file as .java in savaas dialog how can get to know that he has selected the filter .java
hope u understood
please help me
bye
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kumar,
Have a look at the getFileFilter method of JFileChooser. It should give you what you want.
Regards,
Manfred.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!