title: probleme with Jtable in java
body: <p>I have this two String </p>
  
  <pre><code>String[] columnNames
  Object[][] data
  </code></pre>
  
  <p>i fill theme from database;
  I have a <code>JComboBox</code> i want when i select item from the combobox and click <code>button</code> consuler, remove old <code>jtable</code> and repaint the new jtable with new <code>data</code></p>
  
  <p>here is the code of my <code>Jtable</code> that i put it inside the lister of <code>Jbutton</code> Consulter :</p>
  
  <pre><code>if(nbrC != 0){
      JScrollPane scrollPane = new JScrollPane();
      scrollPane.setBounds(62, 200, 457, 113);
      contentPane.add(scrollPane);
      table = new JTable(data, columnNames);
      scrollPane.setViewportView(table);
  } else {
      JOptionPane.showMessageDialog(null, "pas d'horaire ds la BDD", "Erreur", JOptionPane.ERROR_MESSAGE);
  }
  </code></pre>