Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JFileChooser does not display the filename choosen from list

 
Sreedhar P
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic