This method may be the problem,
public void setPlaylist(Playlist playlists){
playlist.add(playlists);
fireTableRowsInserted(playlist.size()-1, playlist.size()-1);
}
Here for example if we got the playlists with size 20. Then after assigning to the table model playlist you are calling,
fireTableRowsInserted(playlist.size()-1, playlist.size()-1);
which will reduce to,
fireTableRowsInserted(19, 19);
But actually what has happened is we are not just inserting one row but 20 rows. So as suggested by @Ivan.Latysh in the answer section, you need to call insert from the start of the row count to the end of the row count. This will repaint
the inserted rows.
P.S: You can simply call fireTableDataChanged();
method also. But this method will repaint
entire table. Prefer this method only if the entire table list is changed. Else you have respective fireXX
methods for Insertion, Update, Delete.