| Author |
Problem with JComboBox and JTable
|
Murali Jaya Rao
Ranch Hand
Joined: Jun 10, 2007
Posts: 43
|
|
Hi all, I have a JTable in that 2 columns are JComboBox and rest are normal text fields. My requirement is if i select first comboBox the second should automatically reflected. I have tried writing the actionPerfomed() method for both but when i click the combobox coloumn jtable returned the row -1. Suggest any ideas. Thanks, Murlai.
|
 |
Brian Cole
Author
Ranch Hand
Joined: Sep 20, 2005
Posts: 852
|
|
Originally posted by Murali Jaya Rao: I have a JTable in that 2 columns are JComboBox and rest are normal text fields. My requirement is if i select first comboBox the second should automatically reflected. I have tried writing the actionPerfomed() method for both but when i click the combobox coloumn jtable returned the row -1.
The place for this is in your table model's setValueAt() method. Set values for both columns and call fireTableRowsUpdated(row, row). [ November 13, 2008: Message edited by: Brian Cole ]
|
bitguru blog
|
 |
 |
|
|
subject: Problem with JComboBox and JTable
|
|
|