Bishop
Bishop

Reputation: 13

How to delete duplicates in a table?

I have written a software that every second copies the contents of a JSON file from a server into a variable (serverData). Using the json-path library I extract some information from the serverData variable and save it in seven different variables relating to the columns of a jTable. In other words, each variable corresponds to a column in the table. The problem is that the file on the server is not updated often, so many duplicate rows are created in the table before the contents of the JSON file are updated. Is there any way to prevent this from happening?

Thanks in advance.

Object[] bookInfo = {SharedData.chapterTitle, SharedData.bookTitle,
    SharedData.chapterNumber, SharedData.volumeNumber, SharedData.translatedLanguage,
    SharedData.authName, SharedData.uploadedAt};

    TablePanel.tableModel.addRow(bookInfo);

Upvotes: 0

Views: 51

Answers (0)

Related Questions