There is a proposal to share examples of how you synchronize the changed data in the JTable with the database, if it’s more like this: there is a table in the database, there is a table in the application, you upload data from the database to the application and edit them in place, respectively, they need to be updated in the database how you store id entries in the application table. To bring it to public view is not kosher as the sequence can be broken. Maybe I complicate and there are ready-made standards.

    1 answer 1

    you have such a problem because you do not have a data model and you are trying to do it the way it was accepted in dolphies. Because of this, there are ridiculous problems. You should dig in the direction of TableModel and DefaultTableModel . Then you can use any of your classes as strings and already store everything you want, and the display of these strings is a separate question.

    Examples on the topic of mass. Here is the very first link from the TableModel documentation: How to Use Tables: Creating a Table Model

    • Ok, I used to get by with arrays, I’ll look at TableModel) - gympi
    • Arrays seem to be a simple solution, but in reality they confuse everything and make the modification difficult. Use separate classes for the rows of the table - this is clearly and conveniently. - cy6erGn0m
    • And what about the performance, let's say I have a table for 50,000 applications, I’ll figure out that it’s stupid to output everything, and the user is normal ... will the memory load much? - gympi
    • one
      50 thousand is a garbage. And if it's not garbage, then you have TableModel at your disposal: use lazy load and some gradual destruction of rows. You do not need to create all instances of the lines, you only need to inform them of the number in advance, and the individual instances of the table itself will ask you as needed. - cy6erGn0m
    • Okie-doki, enlightened) - gympi