getting value at cell
Hi
can any one please help me in getting the value at cell location...i wrote this code and its giving me errors and i dont know how to fix it
public java.lang.Object getValueAt(java.lang.String path, boolean returnDefaultOnNull){
Object columnIndex = 1;
Object rowIndex = 1;
Object value = jTable2.getModel().getValueAt(java.lang.Object rowIndex, java.lang.Object columnIndex);
return value;
jTextField1.setText(String.valueOf(value));
}
can someone please help me it's really important that i fix it!!
Thanks
[580 byte] By [
ElishaWa] at [2007-11-27 8:45:44]

# 1
Don't forget to use the "Code Formatting Tags",see http://forum.java.sun.com/help.jspa?sec=formatting,so the posted code retains its original formatting.The getValueAt(...) method uses "int" variables as parameters, not Objects.
# 3
I don't understand what you are asking. The getValueAt(...) method returns the Object found in the cell in the TableModel. I don't know how the text field is related. If you are talking about the editor then maybe you need to add the following when you create the table:
table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
# 4
You have at least 3 errors in the source you posted.
1. As camickr pointed out, you're passing the wrong type of arguments to the model's getObjectAt().
2. You should not include the type with the parameter in a method call. The type only needs to be declared in the method definition.
3. You're setting the value of the text box after your return statement has terminated the method.