title: java.lang.Object cannot be converted to int
body: <p>I have a problem with downloading the number from JTable. In Eclipse I have jre JavaSE 1.7 and it is all ok. I opened my project in IntelliJ IDEA and chose SDK java jdk 1.8. </p>
  
  <pre><code>private int;
  public void tableEdit(final JTable table) {
  
          table.getModel().addTableModelListener(new TableModelListener() {
              @Override
              public void tableChanged(TableModelEvent e) {
                  // TODO Auto-generated method stub
                  if (table.getCellEditor() != null) {
  
                      int col = table.getSelectedColumn();
                      id =  (int)table.getValueAt(table.getSelectedRow(), 0); //ERROR
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>java: incompatible types: java.lang.Object cannot be converted to int
  </code></pre>
  
  <p>Edit:</p>
  
  <p>New problem:
  The JTable I have 2 fields, ID and field2 (combobox) after selecting the value from the combobox wants to retrieve a value from the ID field so that they know which row I need to update.</p>
  
  <pre><code>categoryBox.addItemListener(new ItemListener() {
              public void itemStateChanged(ItemEvent event) {
                  if (newrow_flag == 0) {
                      JComboBox comboBox = (JComboBox) event.getSource();
                      Object item = event.getItem();
                      if (event.getStateChange() == ItemEvent.SELECTED
                              &amp;&amp; box_flag_category &gt; 0) {
  
                          Category selected_category = (Category) categoryBox
                                  .getSelectedItem();
  
                          int rowid = Integer.getInteger(itemTable.getValueAt(
                                  itemTable.getSelectedRow(), 0).toString()); //Error
  
                          id_category = selected_category.getId();
  
  
                          fireItemEvent(new ItemsEvent(rowid, "produkty", null,
                                  null, null, id_category, id_company, "update"),
                                  "box_category");
  
                      }
                      box_flag_category++;
                  }
              }
          });
  </code></pre>
  
  <p>And error:</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
      at com.magazyn.view.View$9.itemStateChanged(View.java:659)
      at javax.swing.JComboBox.fireItemStateChanged(JComboBox.java:1223)
      at javax.swing.JComboBox.selectedItemChanged(JComboBox.java:1280)
      at javax.swing.JComboBox.contentsChanged(JComboBox.java:1327)
      at javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:118)
      at javax.swing.DefaultComboBoxModel.setSelectedItem(DefaultComboBoxModel.java:93)
      at javax.swing.JComboBox.setSelectedItem(JComboBox.java:576)
      at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:622)
      at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:834)
      at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
      at java.awt.Component.processMouseEvent(Component.java:6527)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
      [...]
  </code></pre>
  
  <p>Error points to this line:</p>
  
  <pre><code>int rowid = Integer.getInteger(itemTable.getValueAt(
                                  itemTable.getSelectedRow(), 0).toString());
  </code></pre>