Has anyone tried setting a table column editor to either a JCheckBox or JComboBox in Java Client?

I have a table set up in Interface Builder where I want one of the columns to display check boxes for booleans instead of "true/false". Having connected it up though, I find that the column displays "true" or "false" , but if I click on the column, the checkbox appears.

Here is the bit of Swing code I use to set the column to use a JCheckBox:

protected static DefaultCellEditor boolean_editor = new DefaultCellEditor (new JCheckBox ());


public static void set_column_boolean (EOTable t, int n) {
t.table ().getColumnModel ().getColumn (n).setCellEditor (boolean_editor);
}

and the definition of the method I have the column connected up to in IB to get the value:

    public Boolean is_paid_for () {
        return new Boolean (paid_for () == null? false: paid_for ().equals ("T"));
    }

I think EO is just taking the string value of the returned Boolean, not letting it go through to Swing, which should display it OK in the check box. Anything else I have missed to get this going?

Thanks
Ian

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Reply via email to