Search:

Type: Posts; User: helloworld922

Search: Search took 0.08 seconds.

  1. Re: How to add file extension to JFileChooser.showSaveDialog() ?

    Yep, there is.

    See: http://www.javaprogrammingforums.com/java-code-snippets-tutorials/4954-java-tipe-aug-4-2010-how-use-file-filters.html
    However, I'm not sure if it will automatically add the...
  2. Re: How to add file extension to JFileChooser.showSaveDialog() ?

    Simply modify the file object you get back:

    File f = c.getSelectedFile();
    String filePath = f.getPath();
    if(!filePath.toLowerCase().endsWith(".txt"))
    {
    f = new File(filePath + ".txt");
    }...
Results 1 to 2 of 2