title: creating comboboxes inside jtable
body: <p>My aim is to provide an interface like a matrix, each cell in matrix will have 2 values and user will select best among the two. </p>
  
  <p>So i thought of going for jTable and combo boxes, the problem is in my matrix the value of each cell in a column is different. But the following code that adds the combo box to whole column of the table and if i change the combo box value, it changes for the whole table. How to insert combo boxes into the table such that each one has different values</p>
  
  <pre><code>javax.swing.JComboBox k = new javax.swing.JComboBox();
          k.addItem("1");
          k.addItem("2");
          k.addItem("3");
          k.setEnabled(true);
          k.setVisible(true);
  this.jTable1.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(k));
  </code></pre>
  
  <p>I also tried with DefaultTableModel</p>
  
  <p>code is</p>
  
  <pre><code>  DefaultTableModel t =new javax.swing.table.DefaultTableModel();
      t.setColumnCount(10);
      t.setRowCount(10);
      t.setValueAt(k, 0, 0);
   jTable1.setModel(t);
  </code></pre>
  
  <p>but i get the output in the gui as</p>
  
  <pre><code>javax.swing.JComboBox[,0,0,0x0,invalid,layout=javax.swing.plaf.metal.MetalComboBoxUI$MetalComboBoxLayoutManager,alignmentX=0.0,alignmentY=0.0,border=,flags=16777544,maximumSize=,minimumSize=,preferredSize=,isEditable=false,lightWeightPopupEnabled=true,maximumRowCount=8,selectedItemReminder=1]
  </code></pre>
  
  <p>I tried typecasting "k" as JComboBox and JComponent in setValueAt method, which didn't work</p>
  
  <p>Someone please help</p>