Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JFileChooser:file name field becomes blank

 
Amol Fuke
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have one problem with JFileChooser.

When I click on save of my frame ,JFileChooser dialog opens with default file name that I have generated and the default folder location is the folder of my Emp id.(I dont know how this is coming?).Problem is when I select any directory other than the my emp id directory and on clicking save button,file name field becomes blank and the dialog box remains on the screen.

Please help.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are any exceptions being thrown? If you run your application from the command line they should appear there.
 
Amol Fuke
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Anyway.

The problem has been solved.I have to overwrite two methods setSelectedFile() and getSelectedFile() in my code.
 
Guido Sautter
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Amon,

I just ran into the same problem of the file name becoming blank when the file filter is changed. With what did you overwrite the setSelectedFile() method to solve the problem?

Thanks for advice,

Guido
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic