title: jTable Encoding in Java
body: <p>I am loading a file, </p>
  
  <p>getting a line from it </p>
  
  <p>and putting it in a jTable</p>
  
  <p>the jTable shows some of my charcters as square boxes.</p>
  
  <p><strong>answers I found online:</strong></p>
  
  <p>1.</p>
  
  <ul>
  <li>it's how the file is opened, so I changed</li>
  <li><code>BufferedReader bf = new BufferedReader(new FileReader(filename));</code></li>
  <li>into</li>
  <li><code>BufferedReader bf = new BufferedReader(new InputStreamReader(new FileInputStream(filename), "UTF8"));</code></li>
  <li>I also tried Charset instead of the string</li>
  </ul>
  
  <p>2.</p>
  
  <ul>
  <li>it's the font, so I tried </li>
  <li><code>jTable1.setFont(new Font("Times New Roman", Font.BOLD, 12));</code></li>
  <li>I tried other fonts, like Arial, David, ...</li>
  </ul>
  
  <p><strong>Can you think of any other reason??</strong></p>
  
  <p>By nachokk's request, here's my code:</p>
  
  <pre><code>        int linecount = 0;
          String line = null;
          BufferedReader bf = new BufferedReader(new InputStreamReader(new FileInputStream(filename), "UTF8"));
          DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
  
          while ((line = bf.readLine()) != null) {
              linecount++;
              model.addRow(new Object[]{filename, linecount, line});
          }
  </code></pre>