I am using TableListBoxModel to display some data in a table format. Initially, I display only part of the data in the table and when the user selects “Display All” button it will display all the available data.
In the button listener function I change the number of rows to reflect all the data and call repaint. I understand that calling repaint does not update the component immediately. But I want the component to be updated as soon as the “Display All” is pressed. The component gets updated only if I resize the window, click on the table header, etc.,
I tried using Timer class and calling repaint in the call back function, which doesn’t make sense because I am calling repaint again in the call back function.
I got it working by deleting the existing Table object and creating a new table object with the updated rows in the button listener. I am not sure if this is an efficient way of doing it. Still I would like to know any other way of updating the table cells.