Article View: borland.public.jbuilder.java.swing
Article #8079tables and comboboxes
From: Marty
Date: Thu, 23 Nov 2000 00:00
Date: Thu, 23 Nov 2000 00:00
34 lines
1523 bytes
1523 bytes
Hi
Im trying to populate a combobox in a table column with differnt values
depending on a value in another column of the corresponding row - eg below -
the values in column 4 are dependent on the value in column 0
But its not working properly - any answers?
Thanks
Marty
public void populate ()
{
for (int i = 0 ; i < this.mTableA.getRowCount() ; i++)
{
int card =((Integer)mTableA.getValueAt(i,0)).intValue() ;
setEditor(mTableA, 4, card) ;
}
}
private void setEditor(StandardTable table, int column, int cardValue)
{
TableColumn dependentColumn =
table.getColumnModel().getColumn(column) ;
StandardComboBox comboBox = null;
DefaultCellEditor cellEditor ;
comboBox = new
StandardComboBox(this.mMyClass.getComboBoxOptions(cardValue));
cellEditor = new DefaultCellEditor(comboBox) ;
dependentColumn .setCellEditor(cellEditor) ;
}
Technical Details
Message-ID:
<3a1d3949_1@dnews>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,ffc432085e90662b,start X-Google-Attributes: gid111d45,public From: "Marty" <mlynch@telesoft-technologies.com> Subject: tables and comboboxes Date: 2000/11/23 Message-ID: <3a1d3949_1@dnews> X-Deja-AN: 697094581 X-Trace: 23 Nov 2000 07:35:37 -0800, 154.32.25.24 X-MSMail-Priority: Normal X-Priority: 3 Reply-To: "Marty" <mlynch@telesoft-technologies.com> Newsgroups: borland.public.jbuilder.java.swing X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700