help needed regarding JFileChooser
hi, this is ravikiran,
I am having a situation where when a save dialog appears, I must provide a default name for the file to be saved in the "File Name" field of save dialog.
Which property of the JFileCooser must be set in order to do this.
help me.
thanx in advance.
[301 byte] By [
raviva] at [2007-11-26 16:10:19]

# 3
hi, thanx for ur reply,
but the code
String path=System.getProperty("user.dir");
filteChooser.setSelectedFile(new File(path+"\\somefile"));
doesn't work for me.
the specified file name doesn't appear in the "File Name" field of save dialog.
help me,
thanx in advance
# 4
The is a method to set the directory and a method to set the file name.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the code retains its original formatting.
# 5
what i am really trying to do is to provide a default file name in the "File name" field of the save dialog(when ever the save dialog appears the default file name should appear in the "File Name" field of the save dialog)
i tried to do the follwing
JfileChooser fc=new JfileChooser();
fc.setSelectedFile(new File("somefile"));
but it doesn't work for me.
help me regarding this.
thanx in advance.