JFileChooser Remembering Previously Selected File
Right now, I have my own custom file chooser class. This is only for
viewing image files. This custom class allows you to preview the image and
everything (using "setAccessory(Component c)"). My question is: when
someone selects a photo and opens it, then that person decides to switch
the photo, how can I make my custom file chooser, when opened again, start
at the file that he or she previously selected (in terms of like
alphabetical order).
For instance, I pick a file called "john.png". I decide I want to switch
to "zomb.png". When I reopen JFileChooser, instead of starting at
"amy.png" (the very first file), it will start at "john.png".
With my custom file chooser, I have already implemented this feature for
my image preview. Where I am having problems is the FilePane. I've tried
"setSelectedFile(File f)", but all that does is change the "File Name:"
textfield to be that file.
No comments:
Post a Comment