I usually use java.lang.Boolean.TRUE in Jython, when Java expects a boolean.

Patrick

----- Original Message ----
From: Craig W <codecraig@gmail.com>
To: jython-users@lists.sourceforge.net
Sent: 06 January 2006 15:59:52
Subject: [Jython-users] javax.swing.table.DefaultTableModel question

I am subclassing javax.swing.table.DefaultTableModel.  I am overriding DefaultTableModel.getColumnClass....

class MyTableModel(javax.swing.table.DefaultTableModel):
    def getColumnClass(self, columnIndex):
        if columnIndex == 0:
            return java.lang.Boolean
        return javax.swing.table.DefaultTableModel.getColumnClass(self, columnIndex)

this doesn't work, gives me a ClassCastException.  I realize it's because of the java.lang.Boolean ...and Jython uses 0/1 for True/False, unlike java.  So, my question is since my TableModel contains True/False (0/1) ...what can I return that is a boolean?  I need this so that a JCheckBox is shown in the Jtable instead of a 0 or 1.  I tried doing,

if columnIndex == 0:
    return int

...but that doesnt help.  Is there some type of Jython boolean I can use?

thanks