java中是否有可用的JSaveChooser
java中有没有像JFileChooser这样的JSaveChooser类型?基本上,当用户在java应用程序中单击“保存文件”按钮时,我希望显示一个类似JFileChooser的对话框,以获取用户保存文件的路径。showSaveDialog方法适用于您java中是否有可用的JSaveChooser,java,Java,java中有没有像JFileChooser这样的JSaveChooser类型?基本上,当用户在java应用程序中单击“保存文件”按钮时,我希望显示一个类似JFileChooser的对话框,以获取用户保存文件的路径。showSaveDialog方法适用于您 JFrame parentFrame = new JFrame(); JFileChooser fileChooser = new JFileChooser(); fileChooser.setDialogTitle("Specify a fi
JFrame parentFrame = new JFrame();
JFileChooser fileChooser = new JFileChooser();
fileChooser.setDialogTitle("Specify a file to save");
int userSelection = fileChooser.showSaveDialog(parentFrame);
if (userSelection == JFileChooser.APPROVE_OPTION) {
File fileToSave = fileChooser.getSelectedFile();
System.out.println("Save as file: " + fileToSave.getAbsolutePath());
}