I am currently working with two JTable. Each of them has its own custom TableModel.

In the first JTable i have items that can be select (checkbox). The second one starts empty. When i check a line in the first table, the backgroundColor of the line changes (thanks to a preparedRenderer method) and i would like the content of the checked line to be added in the second JTable. 

I suppose i should use a TableModelListener but i don't see how i tell the second Table (and its model) to listen to the first one.

Does anyone have some thought about that ?

Here is a sample of what the code i got look like :

```
public class MyClass {

    private Model1 model1;
    private Model2 model2;

    private JTable table1;
    private JTable table2;

    public void myMethod()
    {
        table1 = new JTable();
        model1 = new Model1();
        table1.setModel(model1);

        table1.getModel().addTableModelListener(new TableModelListener()
        {
            @Override
            public void tableChanged(TableModelEvent e) 
            {
                //Here some code to enable a button when at least one row is checked
                //that works fine
            }
        });

        table2 = new JTable();
        model2 = new Model2();
        table2.setModel(model2);
    }
}

```

Thanks for your help :)