File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JFileChooser does not display the filename choosen from list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFileChooser does not display the filename choosen from list" Watch "JFileChooser does not display the filename choosen from list" New topic
Author

JFileChooser does not display the filename choosen from list

Sreedhar P
Greenhorn

Joined: Aug 17, 2002
Posts: 6
I am displaying the names of files uploaded earlier in JList.
Now when a user chooses a file from the list to be downloaded, where i am using JFileChooser to save the file, then i do not get to see the name of the file that is chhosen from the list.
Why so? and how do i get around this problem to display the file choosen from the list?
Sreedhar
VIJAY Yadlapati
Ranch Hand

Joined: Aug 04, 2003
Posts: 175
Before displaying the save dialog, you have to call
setSelectedFile(new File("filename.ext")); on FileChooser.
This will display the filenamem in the File Name textbox.
 
Consider Paul's rocket mass heater.
 
subject: JFileChooser does not display the filename choosen from list