title: Why does my JTable sort integers incorrectly?
body: <p>My JTable sorts integers as 1, 10, 100, 101. It looks like its still sorting it as strings. I've looked at similar Questions and tried adjust as necessary. Am I missing something. I've created this using the netbeans GUI creator if that changes anything. I'm also using the method</p>
  
  <pre><code>listSubTable.setModel(DbUtils.resultSetToTableModel(rs));
  </code></pre>
  
  <p>in another section of the code. This sends the result set to the table. Is this taking precedence over the code below. I changed the switch statement to all integers just in case I was getting columns confused. It still list them as Strings. </p>
  
  <pre><code>    listSubTable = new javax.swing.JTable(){
      public boolean isCellEditable(int rowIndex, int colIndex) {
  
          return false;   //Disallow the editing of any cell
      }
  
  };
  listSubTable.setAutoCreateRowSorter(true); 
  listSubTable.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent e) {
      if (e.getClickCount() == 1 &amp;&amp; isSubdivision()) {
        JTable target = (JTable)e.getSource();
        int row = target.getSelectedRow();
        int column = target.getSelectedColumn();
       if (listSubTable.getSelectedRow() != -1) {
  
                  row = listSubTable.getSelectedRow();
                  archiveNameField.setText("PTC_" + listSubTable.getModel().getValueAt(row, column).toString() + "-V");
  
              }
      }
  if (e.getClickCount() == 1 &amp;&amp; !isSubdivision()) {
        JTable target = (JTable)e.getSource();
        int row = target.getSelectedRow();
        int column = target.getSelectedColumn();
       if (listSubTable.getSelectedRow() != -1) {
  
                  row = listSubTable.getSelectedRow();
                  archiveNameField.setText("");
              }
      }
    }
  });
  listSubTable.setModel(new javax.swing.table.DefaultTableModel(
      new Object [] [] {},
      new Integer [] {
  
      })
      {@Override
          public Class getColumnClass(int column) {
              switch (column) {
                  case 0:
                  return Integer.class;
                  case 1:
                  return Integer.class;
                  case 2:
                  return Integer.class;
                  default:
                  return Integer.class;
              }
          }}
  
          );
  
  listSubTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_NEXT_COLUMN);
  
  
  
  listSubTable.addMouseListener(new java.awt.event.MouseAdapter() {
      public void mouseClicked(java.awt.event.MouseEvent evt) {
          listSubTableMouseClicked(evt);
      }
  });
  
  jScrollPane3.setViewportView(listSubTable);
  </code></pre>