Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • Indeed, tracking all the changes at field level, may flag some changes and when user goes back to the same field editing it back to the initial value, it would be another change whereas no change occurred if you compare the final to the initial state. Commented Jul 7 at 14:41
  • One drawback is a DB row may have nulls. But a JTextField never returns nulls when queried. So whenever you collect all the data in the GUI, including text fields, you never collect any null strings, only empty strings. And then when you compare that never-null data to nullable DB data (that you loaded initially), you may easily get false positives. I'm not sure yet how we can overcome this in a graceful manner Commented Jul 9 at 10:22
  • @SergeyZolotarev populate the form from DB, immediately collect a snapshot, then compare state with the snapshot instead of DB. Nullability issue goes away that way. Commented Jul 9 at 10:26
  • @Basilevs "compare state" what state? The GUI state? It's never null because of the text fields, that's the problem Commented Jul 9 at 10:30
  • @SergeyZolotarev in this scenario you always compare "snapshots" - it is an object that is populated initially and every time user makes a change. The nullability within these snapshots is irrelevant because it is always the same, as snapshots are collected by the same code. Commented Jul 9 at 10:33