This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 41155
    
  45
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JFileChooser:file name field becomes blank
 
Similar Threads
Setting default name in JFileChooser
JFileChooser save dialog without filename
In JFileDialog how to use the save window
File Save is not following the directory given to it by the SaveDialog
JFileChooser