I have two JTables extend DefaultTableModel. I would to know how to change the contents of second table when I double click rows in the first table. Thanks
Hi Narayanan, Hope the following example I wrote helps... it is very basic, but I am sure it would give you an idea of how to go achieve your goal... The main class...
Thats was really helpful to me. Since I am implementing TableModel with DefaultTableModel interface and I have object[][] array, what is the best way of manipulating table contents. I have tried by creating a method in one of my tableModel class but it always gives ArrayOutOfBound Exception. Do I have to recreate JTable and TableModel objects every time user selects a record from first table ? Appreciate your help. Thanks
Hi, I am afraid I can't help with the DefaultTableModel. I have always found that creating a TableModel from an AbstractTableModel gives me all the flexibility I need. Regarding recreating of JTable and TableModel... again, once I have created a TableModel using the AbstractTableModel, I have never had to recreate the Table or the Model when the data inside changes. As you can see in the example I gave, the Table and the Model are created just once. Best regards, Abhik.
The first person to drink cow's milk. That started off as a dare from this tiny ad: