title: Create .txt file inside project
body: <p>I want to create a new <code>.txt</code> file inside my project folder and I want to give it this path:</p>
  
  <pre><code>Contents/FrameClasses/Data/Datafiles/MYFILE.txt
  </code></pre>
  
  <p>What I use to make the folder is this:</p>
  
  <pre><code>File MYFILE = new File("Contents/FrameClasses/Data/Datafiles/MYFILE.txt");
  MYFILE.getParentFile().mkdir();
  try{
      if(MYFILE.createNewFile()){
          //do stuff here
      }
  }catch (Exception e){
      //do stuff with the exception...
  }
  </code></pre>
  
  <p>Whenever I do this I get an error saying:</p>
  
  <blockquote>
    <p>java.io.IOException: No such file or directory</p>
  </blockquote>
  
  <p>The error is fixed if I add <code>src/</code> to the beginning of my path and make it like this:</p>
  
  <pre><code>src/Contents/FrameClasses/Data/Datafiles/MYFILE.txt
  </code></pre>
  
  <p>But the <code>src/</code> is not part of my project as <strong>everything</strong> is contained inside the <code>Contents</code> folder I've made. When I build the <code>.jar</code> file it gives the same error if I run it once I add the <code>src/</code> to the path.</p>
  
  <p>What would be the proper way to create this file ?<br>
  <strong>PS</strong>: I've tried using a shorter path like this one as well: <code>Datafiles/MYFILE.txt</code> without success. Also, the class I use to make the file is contained inside the folder <code>Data</code> alongside with <code>Datafiles</code> as shown in the original path.</p>