how to pass a file name as a parameter to JFilechooser file name text-field?
I am trying to pass a filename as a parameter using table select row filename path to jFilechooser File
Name but I don't know how to do that?
Here is my Code:
JFrame parentFrame = new JFrame();
JFileChooser fileChooser = new JFileChooser();
fileChooser.setDialogTitle("Specify a file to save");
int userSelection = fileChooser.showSaveDialog(null);
if (userSelection == JFileChooser.APPROVE_OPTION) {
File fileToSave = fileChooser.getSelectedFile();
}
Here is the project image: