Ti posto un po' di codice
codice:
import javax.swing.*;
import java.awt.*;
/**
*
* @author Andrea
*/
public class JTableCast extends JFrame {
private JTable table;
/** Creates a new instance of JTableCast */
public JTableCast() {
super("JTable Test");
this.setSize(300,300);
String[] headers = {"Colonna 1", "Colonna 2", "Colonna 3"};
Object[][] data = new Object[3][4];
for (int i=1; i <= data.length; i++) {
for (int j=1; j <= data[0].length; j++) {
data[i-1][j-1] = new String((10*i+(j-1)*100)+"");
//data[i-1][j-1] = new Integer(10*i+(j-1)*100);
}
}
table = new javax.swing.JTable(data, headers);
this.getContentPane().add(new JScrollPane(table));
//int i = ((Integer)table.getValueAt(2,2)).intValue();
int i = (new Integer((String)table.getValueAt(2,2))).intValue();
System.out.println(i);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main (String[] args) {
new JTableCast();
}
}
Se decommenti le righe commentate e commenti quelle attualmente in escuzione, vedrai che la cosa funziona alla stessa maniera. Tu mi sa che hai mischiato i due casi.