I want to extend the DefaultTableModel class with a function that let's me set the color of a specific row. So lets say I have a table with 30 rows and want to color row 12 in red.
I want to invoke a function like:
JTable table = new JTable();
DefaultTableModel model = new DefaultTableModel();
table.setModel(model);
[...]
model.setRowColor(12, Color.RED);
[...]
I know that there are many similar questions regarding the topic "color a JTable row" but I was not able to implement any of these solutions. Maybe somebode could help me to understand custom renderers and how to implement my custom method.