我在使用jFileChooser.showSaveDialog()的时候,如何初始化所有保存文件的名字,
即在输入文件名的一栏中默认的输入一个文件名?谢谢了

解决方案 »

  1.   

    JFileChooserpublic JFileChooser(File currentDirectory)
    Constructs a JFileChooser using the given File as the path. Passing in a null file causes the file chooser to point to the user's default directory. This default depends on the operating system. It is typically the "My Documents" folder on Windows, and the user's home directory on Unix.Parameters:currentDirectory - a File object specifying the path to a file or directory
      

  2.   

    JFileChooser chooser = new JFileChooser();
    chooser.setSelectedFile(new File("C:\\a"));