title: Sort files by name in Java differs from Windows Explorer
body: <p>I have a simple Java program which reads a file directory and outputs a file list.
  I sort the files by name:</p>
  
  <pre><code>String [] files = dirlist.list();
  files = sort(files);
  </code></pre>
  
  <p>My problem is that it sorts by name in a different way than Windows Explorer does.</p>
  
  <p>For instance if I have these files: abc1.doc, abc12.doc, abc2.doc.</p>
  
  <p>Java will sort like this:</p>
  
  <pre><code>abc1.doc
  abc12.doc
  abc2.doc
  </code></pre>
  
  <p>When I open the folder in Windows Explorer, my files are sorted like this:</p>
  
  <pre><code>abc1.doc
  abc2.doc
  abc12.doc
  </code></pre>
  
  <p>How can I make Java sort my files like in Windows Explorer?
  Is this a Windows trick?</p>