title: How do I make a file in java.io.file?
body: <p>So I was making a program called &quot;TextCreator&quot;, and I ran into a problem, and it was that my program was not creating files. I wanted to make a file called &quot;file.txt&quot;, and here's my code:</p>
  <pre><code> String fileName = TxtName.getText();
    File file = new File(&quot;file.txt&quot;);
  </code></pre>
  <p>Because this was not working, I tried creating a file on my pc called &quot;file.txt&quot;, and that did not work either. I am using java.io.file.</p>