• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
JCheckBox in Java Client table
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

JCheckBox in Java Client table


  • Subject: JCheckBox in Java Client table
  • From: Ian Joyner <email@hidden>
  • Date: Mon, 5 Dec 2005 17:25:06 +1100

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      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: JCheckBox in Java Client table
      • From: Ian Joyner <email@hidden>
  • Prev by Date: Re: Stale data in EC
  • Next by Date: Re: How to manage long running tasks
  • Previous by thread: Re: Locking/Unlocking-Problem with EditingContext
  • Next by thread: Re: JCheckBox in Java Client table
  • Index(es):
    • Date
    • Thread