Thread Subject: Putting checkboxes in only some rows of a uitable

Subject: Putting checkboxes in only some rows of a uitable

From: Matthew Whitaker

Date: 24 Mar, 2008 23:27:02

Message: 1 of 2

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

Subject: Putting checkboxes in only some rows of a uitable

From: Lihua Pan

Date: 29 Jan, 2009 09:37:02

Message: 2 of 2

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

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
jtable Alessandro Giusti 15 Apr, 2009 12:47:43
table Lihua Pan 29 Jan, 2009 04:40:21
java Lihua Pan 29 Jan, 2009 04:40:21
swing Lihua Pan 29 Jan, 2009 04:40:21
jtable Matthew Whitaker 24 Mar, 2008 19:30:22
uitable Matthew Whitaker 24 Mar, 2008 19:30:22
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com