title: Recognizing File Extension , Printing with different color to JTextArea
body: <p>I can recognize file extensions but still cant give different color for different extensions  when I am printing to TextArea , is it because TextArea and all the font changes after running the program to *"serif", Font.ROMAN_BASELINE, 5*</p>
  
  <pre><code>  public void setScanResult(ArrayList&lt;String&gt; x) {
  
  
      for (int i = 0; i &lt; x.size(); i++) {
  
          if (x.get(i).endsWith(".txt")) {
  
              Font fono1 = new Font("sansserif", Font.BOLD, 50);
              textArea.setFont(fono1);
              textArea.append((String) x.get(i));
          } else if (x.get(i).endsWith(".xls")) {
  
              Font fono2 = new Font("Monospaced", Font.ITALIC, 10);
              textArea.setFont(fono2);
              textArea.append((String) x.get(i));
          } else {
  
              Font fono3 = new Font("serif", Font.ROMAN_BASELINE, 5);
              textArea.setFont(fono3);
              textArea.append((String) x.get(i));
          }
          textArea.append("\n");
          //textArea.append((String) x.get(i));
  
      }
  
      x.clear();
  </code></pre>