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
|