title: How to insert data into JTable?
body: <p>i write this code for showing strings in a table.</p>
  
  <p>but it doesnt shown and has no effect.</p>
  
  <p>what is problrem?   </p>
  
  <pre><code> public pamnel() {
              initComponents();
               String[] columnNames = {"First Name",
                              "Last Name",
                              "Sport",
                              "# of Years",
                              "Vegetarian"};
  
  
  
      Object[][] data = {
          {"Kathy", "Smith",
           "Snowboarding", new Integer(5), new Boolean(false)},
          {"John", "Doe",
           "Rowing", new Integer(3), new Boolean(true)},
          {"Sue", "Black",
           "Knitting", new Integer(2), new Boolean(false)},
          {"Jane", "White",
           "Speed reading", new Integer(20), new Boolean(true)},
          {"Joe", "Brown",
           "Pool", new Integer(10), new Boolean(false)}
      };
  
       jTable1 = new JTable(data, columnNames);                      
  
   }
  </code></pre>
  
  <blockquote>
    <p>Edit:
    I add Jtable on a panel.</p>
  </blockquote>
  
  <p>in the main add panel to a jframe.</p>
  
  <pre><code> JFrame frame = new JFrame();
      frame.add(new pamnel());
      frame.setVisible(true);
      frame.setSize(600, 600);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  </code></pre>
  
  <p>The table is shown but data isn't show.
  the row and column of table is empty!</p>