I am using JXTable to display a list of records.
When I click "Refresh" button, I want the JXTable to be refreshed to display the newly inserted records.
And also when I click "Add new Row" button, a new row must be added to JXTable.
How can I do these? I am unable to find any useful reference or samples. Please guide me.
                        
It works the same as with a regular
JTable, which is all explained in the table tutorial. But to answer your questions:TableModel. The moment you update yourTableModelyou should fire the appropriate events so that theJTableis aware of the changes made to the model. At that moment, theJTablewill refresh itself automatically. If yourTableModelextends fromDefaultTableModelthere are already methods available which take care of the events (like e.g.insertRow)TableModel+ firing the appropriate events. If you use aDefaultTableModel, you can use the available API of theDefaultTableModel