aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JFileChooser:file name field becomes blank Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFileChooser:file name field becomes blank" Watch "JFileChooser:file name field becomes blank" New topic
Author

JFileChooser:file name field becomes blank

Amol Fuke
Ranch Hand

Joined: Apr 08, 2005
Posts: 129
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.


"There are no mistakes, only lessons"
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41579
    
  54
Are any exceptions being thrown? If you run your application from the command line they should appear there.


Ping & DNS - my free Android networking tools app
Amol Fuke
Ranch Hand

Joined: Apr 08, 2005
Posts: 129
Thanks Anyway.

The problem has been solved.I have to overwrite two methods setSelectedFile() and getSelectedFile() in my code.
Guido Sautter
Ranch Hand

Joined: Dec 22, 2004
Posts: 142
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
 
 
subject: JFileChooser:file name field becomes blank