I want to save a file with user’s choice but there seem a compulsion to give a name in the given field. But I want that user chooses only the location where to save the file.
Is there any another way to do it with or without using the dialogs?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
JFileChooserallows to only select directories, which you can use to allow the user to choose the location without having to specify the file name. See thesetFileSelectionModemethodEdit
The following code allows me to just select a directory and hit the OK button
You could possible opt to already select a default destination. If the default is good enough for most cases, in most cases the user only has to hit the enter key.
If this is not what you mean I am afraid I did not understand your requirement.