i already googled and search this forum but i didnt find anything what helps me...
i have a application which has some problems with its jtable (the table headers are not updated, columns cant be removed etc.)
so i created a little app to see if this always occurs:
i use netbeans which uses some default data (column headers)
when i hit jbutton1 it adds a column called "blah" and when i hit multiple times jbutton2 the columns get deleted
but when i hit the jbutton1 again all columns are back again and i dont understand why
When you call setModel the column model is rebuilt. But why are you calling setModel? The call to DefaultTableModel's addRow method should already add a new row to the GUI automatically - it notifies the JTable.
i thought i have to retrieve the model, modify it and set it back (but getModel doesnt return a copy, it returns a reference)
thats clear now, thanks
when i hit jbutton1 it adds a new column, then i click on the jbutton2 until theres only one column left and (thats the problem) now i click the jbutton1 again
now i have all columns back and thats not what i expected