G
Guest
I have following code:
JFileChooser fc = new JFileChooser();
fc.setFileFilter(/* my class*/ new ExtensionFileFilter("html", "HTML
File"));
int returnVal = fc.showSaveDialog(m);
if(returnVal != JFileChooser.APPROVE_OPTION) return;
.......
with second line I force dialog to show only html files.
But I want, when I choose file e.g. "out" then I want final file will be
"out.html" and if I choose "file.html" the final file will be "file.html"
Is this possible with JFileChooser, or I must write 2 or 3 lines of code?
JFileChooser fc = new JFileChooser();
fc.setFileFilter(/* my class*/ new ExtensionFileFilter("html", "HTML
File"));
int returnVal = fc.showSaveDialog(m);
if(returnVal != JFileChooser.APPROVE_OPTION) return;
.......
with second line I force dialog to show only html files.
But I want, when I choose file e.g. "out" then I want final file will be
"out.html" and if I choose "file.html" the final file will be "file.html"
Is this possible with JFileChooser, or I must write 2 or 3 lines of code?