Add or remove a row on a jtable with Netbeans 6.0
Hello people. Im as using Netbeans 6.0. I created a form with a few combo boxes, radio buttons, labels, button, and a jtable. What im doing is im reading data out of a table in mysql and then i populate the jtable with the data. How it works is the person selects one of the 3 radio buttons, then they click on button to view the results for that selected option. The problem comes in when a long list is being (the "Year" option is selected)displayed and the person chooses another option that brings back a shorter list(the "Week" option is selected). Then the long list remains in the table. Could anyone please help me with a solution?
Re: Add or remove a row on a jtable with Netbeans 6.0
If you post some sample code that reproduces the problem it would help tremendously. I'd suggest writing your own TableModel (perhaps an extension from DefaultTableModel) if you have not already. Regardless, any changes to the back-end of the model (eg the data being displayed) should be accompanied by calling one of the appropriate 'fire..' methods on the table model (see AbstractTableModel), the most general being fireTableDataChanged().