JTable Boolean cell .. how to read it

Posted by dimitar on Stack Overflow See other posts from Stack Overflow or by dimitar
Published on 2010-05-26T10:29:22Z Indexed on 2010/05/26 10:31 UTC
Read the original article Hit count: 298

Filed under:
|

Hello guys, i have a table with a column that contains Boolean type.

now when i try to run a program i have a problem:

System.out.println(table.getColumnClass(5));

b= (Boolean)table.getValueAt(row, 5);

It prints

class java.lang.Boolean

but also:

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

and i even try with

b= (Boolean)table.getValueAt(row, 5);
b= Boolean.parseBoolean((String)table.getValueAt(row, 5));
b= table.getValueAt(row, 5);

but those show error too.

So how to fix this guys?

© Stack Overflow or respective owner

Related posts about jtable

Related posts about boolean