1) How do I know any fields on the JFrame window is changed or touched? Currently I used a static variable, but don't know when to change it to "true",
I have tried to set the flag in JFrame.propertyChanged. But it is true always whenever I quit the form.
2) If I am editing a cell on a JTable whilst I quit the form, the data is not saved. How do I prevent that from happening? How do you find out the values on the JTable Cell that is left out orphan?
Thanks
Jack
1) How do I know any fields on the JFrame window is changed or touched?
Depends on what you mean by "changed or touched" and what fields are in question.
If by "touched" you mean "focus", then you might want to take a look at How to Write a Focus Listener tutorial. As for "changed" I can only assume you are talking about text components, though I would recommend How to Write a Document Listener tutorial. For any other case (if I was wrong) you would need to be more specific.
2) If I am editing a cell on a JTable whilst I quit the form, the data is not saved. How do I prevent that from happening? How do you find out the values on the JTable Cell that is left out orphan?
> 2) If I am editing a cell on a JTable whilst I quit the form, the data is not saved. How do I prevent that from happening?
set the default close operation to DO_NOTHING_ON_CLOSE
add a windowListener, and in windowClosing you check the status
of a dirtyData flag to see whather to exit, or to save, or to give user option to save.
a listener to your tabel would set the flag to dirty on any change, and when saved,
flag set to OK