title: can't get endsWith(".java") to work
body: <p>I am looping through all .jar files in a directory and looking to display the .jar filename and only ".java" filenames within the .jar in a dialog box.
  I am almost correct, but all filenames within the .jar are displayed.
  my working code is:</p>
  
  <pre><code>for (Enumeration em1 = jarfile.entries(); em1.hasMoreElements();)
  {
      notes = Collections.list(em1);
  }
  
  JOptionPane.showMessageDialog(null, jarName + "\n" + notes);
  </code></pre>
  
  <hr>
  
  <p>When i try to weed out only the (".java") filenames, I can't get it right...</p>
  
  <pre><code>for (Enumeration em1 = jarfile.entries(); em1.hasMoreElements();)
  {
      if(em1.endsWith(".java"))
      {
          notes = Collections.list(em1);
      }
  
  }
  JOptionPane.showMessageDialog(null, jarName + "\n" + notes);
  </code></pre>
  
  <p>I'm hoping it's something syntaxtically stupid. I've tried many possibilities for hours. Can somebody can help me clear this up?</p>