title: saving word file in a particular location
body: <p>I want to save my file in user selected location in java swing application. I am generating word file dynamically. Moreover When I am putting like this </p>
  
  <pre><code>FileWriter _file = new FileWriter("C:/Calender"+.doc", true);
  </code></pre>
  
  <p>the file is getting generated in c:/ drive directly in the name of Calender.doc.</p>
  
  <p>However If i am passing path through </p>
  
  <pre><code>jfilechooser.getSelectedFile().getAbsolutePath()
  </code></pre>
  
  <p>returning the value <code>"C:\Users\Shorav\Desktop"</code> is not saving any file in this location.</p>
  
  <p>Please help; how to save the file.</p>
  
  <p>Code is </p>
  
  <pre><code>chooser = new JFileChooser();
          chooser.setCurrentDirectory(new java.io.File("."));
          chooser.setDialogTitle("Select location to save the file");
          chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
          chooser.setAcceptAllFileFilterUsed(false);
  
          if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
  //          System.out.println("getCurrentDirectory(): "+ chooser.getCurrentDirectory());
  //          System.out.println("getSelectedFile() : "+ chooser.getSelectedFile());
              System.out.println("Absolute Path : " +chooser.getSelectedFile().getAbsolutePath());
          } else {
              System.out.println("No Selection ");
          }
  </code></pre>
  
  <p>This will ask from User for desired location  to save the file.</p>
  
  <p>Then this is returning the path by <code>C:\Users\Shorav\Desktop</code>. I want to generate the word file  on this location through the following</p>
  
  <pre><code> FileWriter _file = new FileWriter("C:/Calender"+.doc", true);
  </code></pre>
  
  <p>This is returning word file.</p>