Program error

Hi

I have the following piece of code in my program which accesses an object in a jTable and sets the selected item in a jComboBox according to the value in the table

<code>

if( Integer.parseInt( (String)jTable1.getValueAt(FLUX_CURVE_ROW,Run) )==1)

{

jCheckBox1.setSelected(true);

}

An error is returned which is

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String

Does anyone know why?

Thanks in advance

[547 byte] By [mmidea] at [2007-11-27 4:58:38]
# 1
I would assume that the object retrieved byjTable1.getValueAt(FLUX_CURVE_ROW,Run)is an Integer.
masijade.a at 2007-7-12 10:14:36 > top of Java-index,Java Essentials,New To Java...
# 2
masijade talkes right.try the following :if ((jTable1.getValueAt(FLUX_CURVE_ROW,Run)).toString() == 1)or if (jTable1.getValueAt(FLUX_CURVE_ROW,Run).inValue() == 1)Good LuckAhmad
NourElsaftya at 2007-7-12 10:14:36 > top of Java-index,Java Essentials,New To Java...