title: How to save files in Java using variables in absolute path?
body: <p>My problem is saving documents in Netbeans. I created a program using Java in Netbeans. At first you register (at the click on register button a new user Map is created with the name of the user), then you login with your user name and your password. When you are logged in, the program displays a new window where you can create documents. You can write text in TextArea. Then when you're finished with writing your text you click on Save button and the text you've written saves in a document named after the text you've given in a jTextField. So for every different login the absolute path changes. </p>
  
  <p>This is my code in submit button:</p>
  
  <pre><code>//ccc is the name of user map
  String ccc = LogIn.uporabnik1;
  try{
      FileWriter writer = new FileWriter("C:\\Users\\ALEKS\\Documents\\NetBeansProjects\\EasyEdit\\"+ccc+"\\"+FileName+".txt");
      BufferedWriter bw = new BufferedWriter (writer);
      jTextArea1.write(bw);
      bw.close();
      jTextArea1.setText("");
      jTextArea1.requestFocus();
      writer.close();
  }
  catch(Exception e){
      JOptionPane.showMessageDialog(null, e);
  }
  </code></pre>