I am using a JTable with a class I wrote exteding AbstractTableModel for the data model. When I perform a search on the gui I update the data in the model, but to get the new search results to be displayed I have to click on a column header on the table. Then the results are displayed correctly. I have tried to call repaint() and updateGUI() on the table to refresh the view after the search but I get null pointer exception on both of them. What is the proper way to refresh the display of data from the updated values in the model on the JTable? Thanks, Dave
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Remember to call fireTableDataChanged() in your AbstractTableModel subclass when you update the data it holds... Hope this helps!!! Benjam�n
Ravikiran Choppalli
Ranch Hand
Joined: Nov 18, 2000
Posts: 49
posted
0
Have a update() function in your customtablemodel class, pass the data that needs to be updated and call fireTableDataChanged(). This WORKS.