title: JTable's JComboBox cell editor sets the value already when opening the list, even if clicked outside the combo-box
body: <p><code>JTable</code>'s <code>JComboBox</code> cell editor sets the value already when opening the list, even if clicked outside the combo-box. Moreover, once certain value selected, next time the selection is opened, that value becomes the default:</p>
  
  <p><a href="https://i.stack.imgur.com/gZhNO.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gZhNO.gif" alt="enter image description here"></a></p>
  
  <p>Here is the code:</p>
  
  <pre><code>public class Main {
      public static void main(String[] args) {
          new QuestionFrame();
      }
  }
  </code></pre>
  
  <p><code>QuestionFrame</code>:</p>
  
  <pre><code>import javax.swing.*;
  import javax.swing.table.AbstractTableModel;
  import java.awt.*;
  
  class QuestionFrame extends JFrame {
      QuestionFrame(){
          class Model {
              int num;
              private Model(int n) { num = n; }
          }
          final Model[] model = {new Model(9), new Model(8), new Model(7)};
  
          JPanel panel = new JPanel(new BorderLayout());
          JTable table = new JTable(new AbstractTableModel(){
              @Override public int getRowCount() { return model.length; }
              @Override public int getColumnCount() { return 1; }
              @Override public Object getValueAt(int rowIndex, int columnIndex) {
                  return model[rowIndex].num;
              }
              @Override public String getColumnName(int column){ return "NUM"; }
              @Override public Class&lt;?&gt; getColumnClass(int columnIndex) { return Integer.class; }
              @Override public boolean isCellEditable(int rowIndex, int columnIndex) { return true; }
              @Override public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
                  model[rowIndex].num = (int) aValue;
              }
          });
          DefaultCellEditor cellEditor = new DefaultCellEditor(new JComboBox&lt;&gt;(new Integer[]{1,2,3}));
          cellEditor.setClickCountToStart(1);
          table.getColumnModel().getColumn(0).setCellEditor(cellEditor);
          panel.add(new JScrollPane(table), BorderLayout.CENTER);
  
          setBounds(new Rectangle(500,250,200,200));
          add(panel);
          setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
          setVisible(true);
      }
  }
  </code></pre>
  
  <p>It's somewhat makes sense, as <code>setCellEditor(cellEditor)</code> reuses the same <code>JComboBox</code> object instance, but I couldn't find another way to do it..</p>
  
  <p>So how to solve it?</p>