A
Anand Gopinath
Hi,
I was wondering if anyone could tell me if there is a way to accomplish
what I am doing.
I want to display a default filename (for the user to save) to the user
and let it stick around if the user changes the file filter.
To do that, I have a JFileChooser and I set a default filename when it
is presented to the user. That file probably does not exist, I use the
setSelectedFile( File ) call to do that. That sets the name in the
File Name text field.
The problem I am having is this: when the file filters are changed, the
filename I set gets cleared. I would like to set it back to what it was
once the file filter does its thing. I listen to the properties
FILE_FILTER_CHANGED_PROPERTY and the SELECTED_FILE_CHANGED_PROPERTY to
get the old filename and that works once the user actually selected a
file. It does not work for the filename I set or anything else the user
might be typing into the File Name text field.
Is there a way to get the text in the File Name text field when the file
filter is changed?
Thanks,
Anand
I was wondering if anyone could tell me if there is a way to accomplish
what I am doing.
I want to display a default filename (for the user to save) to the user
and let it stick around if the user changes the file filter.
To do that, I have a JFileChooser and I set a default filename when it
is presented to the user. That file probably does not exist, I use the
setSelectedFile( File ) call to do that. That sets the name in the
File Name text field.
The problem I am having is this: when the file filters are changed, the
filename I set gets cleared. I would like to set it back to what it was
once the file filter does its thing. I listen to the properties
FILE_FILTER_CHANGED_PROPERTY and the SELECTED_FILE_CHANGED_PROPERTY to
get the old filename and that works once the user actually selected a
file. It does not work for the filename I set or anything else the user
might be typing into the File Name text field.
Is there a way to get the text in the File Name text field when the file
filter is changed?
Thanks,
Anand