I have this JTable
having a DefaultTableModel
as its model.
On the table I have several swing component, JComboBox
and JCheckBox
, set on a particular column via DefaultCellEditor
and DefaultCellRenderer
.
The TableModelListener
was added to the table to capture changes on editable columns.
The rest of the columns will display details of the selected component, i.e. item code -> item price, item count, item classification,etc.
I have this problem wherein if the selectedItem of the JComboBox(itemCode)
changes, the items of the other JComboBox(itemClassification)
changes. But together with the change of the other JComboBox I need to display the item price on the same table. This change refires the valueChanged
method which makes an infinite loop of valueChanged
.
How can I get rid of the infinite loop thing?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…