Hi
I have a jframe with a table and a button to add the values from table into a doucment. Here is the code i used..
for(int i = 0; i<rowCount; i++){
try {
document = document + "\n" + (i+1)+". "+((javax.swing.table.DefaultTableModel)tblMatching.getModel()).getValueAt(i, 0).toString()+"::"+((javax.swing.table.DefaultTableModel)tblMatching.getModel()).getValueAt(i, 1).toString();
}
catch(Exception e) {
javax.swing.JOptionPane.showMessageDialog(this,"Please don't leave the Question or Answer column blank."+e);
return;
}
}
After entering the values in the table and I click the Add button,
In the last row, last column a null value is returned.
But after changing the focus to any other cell, I'm able to get the correct values.
Can somebody help me why this is happening ??
Please help me to sort out this problem !!
[Message sent by forum member 'javapedant' (javapedant)]
http://forums.java.net/jive/thread.jspa?messageID=285676---------------------------------------------------------------------
To unsubscribe, e-mail:
jdnc-unsubscribe@...
For additional commands, e-mail:
jdnc-help@...