title: Creating a JTable
body: <p>I've been trying to create a table as follows:</p>
  
  <pre><code>public class SearchArray {
      public String[] columnNames = {"First Name", "Last Name", "Sport", "# of Years", "Vegetarian"};
      public Object[] data = {"First Name", "Last Name", "Sport", "# of Years",};
  
      JTable table;
  
      JTable search() {
          table = new JTable(data, columnNames);
          return table;
      }
  }
  </code></pre>
  
  <p>I, however, keep getting a "no suitable constructor found for JTable(Object[], String[]".</p>
  
  <p>I'm not sure what it is that I'm getting wrong. I'd really appreciate some help. Thank you in advance.</p>