Possible Duplicate:
adjust selected File to FileFilter in a JFileChooser
I have a JFileChooser
with a FileFilter
(txt
, doc
, odt
) and I want to save an existing file.
So I open the file chooser GUI and enter the name for the file to save (e.g. test.doc). After this, I change the file type from the dropdown list to see only e.g. .txt
files.
At this time, the file-extension from test.doc
should change to test.txt
, but how to do it? I cannot add an ActionListener
to the file filter.