Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Putting checkboxes in only some rows of a uitable
Date: Thu, 29 Jan 2009 09:37:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 24
Message-ID: <glrtbu$f57$1@fred.mathworks.com>
References: <fs9dc5$7b7$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1233221822 15527 172.30.248.37 (29 Jan 2009 09:37:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 29 Jan 2009 09:37:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1642438
Xref: news.mathworks.com comp.soft-sys.matlab:514662


It seems that I have the same problem with you.
I've created a JTable to display a property list(property name and value), some row should be a combo and some checkbox. But in JTable it is only allowed to set the cellEditor for one column, so I' like to use a indirect way. That is by double mouse click on a table cell, it will pop up a combo box and let you select the value. However, I can not find a callback function which can handle the event correctly without overriding the java class. If use such as "ValueChangedCallback" of selection listener or "PropertyChangeCallback" of JTable, the change effect of the cellEditor will be applied only when you click on a next cell.
Has anyone similar experience or any alternative suggestion?
Thank you for your help!

"Matthew Whitaker" <mattlwhitaker@REMOVEgmail.com> wrote in message <fs9dc5$7b7$1@fred.mathworks.com>...
> Hello,
> I'm trying to create something similar to the property 
> editor for a structure. I can create a uitable(old style - 
> using R2006b) and set the columns to the fieldnames and 
> values (similar to the ipttable function). However I'd like 
> to show the fields that are boolean values as check boxes. 
> It seems that matlab/java really wants the whole column to 
> be the same( textbox, combo, checkbox...). Is there a way 
> to give individual cells different renderers (e.g cell(1,1) 
> to be a textbox, cell(2,1) to be a check and so on down the 
> column.
> 
> Or is the uitable/JTable really the wrong component for 
> this?
> 
> Thanks in advance for your assistance
> Matt