• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in JFileChooser

 
arfa shah
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to restrict user to select only xml files in JFileChooser. I used FileFilter but it also shows �all Files� option so i cannot restrict user to select only xml files
pleasse help me
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
post your code so we can see how you're doing it
 
Alice Corman
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html

"By default, the list of user-choosable filters includes the Accept All filter, which lets the user see all non-hidden files. This example uses the following code to disable the Accept All filter:"

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!