Hi All, Can anyone explain to me why this happens? I have a very simple custom JTable, and I have overridden the getValueAt(int row, int col) method. (Note: My overridden method makes no sense. I am just experimenting here.) What happens when I instantiate my custom JTable is that the getValueAt() method is also called automatically. Why does this happen? Many thanks for your help!! Barry Here is the custom JTable:
Barry It looks like the getValueAt method is being called (maybe by the JVM or by the Frame) when it actually paints/displays the table on the screen. In the code below I added a static variable to keep track of the nmber of times the getValueAt method is called and it is called each time cell in the table is created/painted.
Then I added this code into your getValueAt method:
every other cell is correct and the others still show the "I am overriding..." String. so it looks like this is called for each cell as it is displayed. someone else may know exactly what is going on and can shed more light on it than me... hope that helps
------------------ Dave Sun Certified Programmer for the Java� 2 Platform
subject: Why does overridden method get called when class is created