I have a GUI which has a JComboBox and a JTable.
- The
JComboBoxitems areYesandNo. - The
JTablehas 2 columns and 2 rows. - If I select
YesinJComboBox, the second column should be displayed gray color and else white color.
How to do this? Is there any method to set the color without rendering?
The article How to Use Tables: Concepts: Editors and Renderers shows how to use renderers. Just have your
JComboBoxaction listener update the background color of yourDefaultTableCellRenderersubclass.