Notify a JButton to know which was changed
<p>I have created separate stored procedures for every update action on my components.</p>

<p>Here are the stored procedures:</p>

<pre><code>updateCurriculumName() --call only if name was changed
updateCurriculumYearLevel() --call only if year level was changed
updateCurriculumSchoolYear() -- call only if school year was changed
updateCurriculumDescription() -- call only if description was changed
updateCurriculumSubjects() -- call only if there are changes made on assigned subjects
</code></pre>

<p>I need to be able to notify the <code>SAVE</code> button for it to know which component was modified/changed so that it will know which procedure to call and not call all procedures.</p>

<p>For instance, if only the curriculum's name was changed, therefore, it should only call the <code>updateCurriculumName()</code> procedure.</p>

<p>Notice I mark the JLabel's text with <code>*</code> if changes were made to a JTextField or JComboBox or JTextArea. </p>

<p>I currently have,</p>

<p><code>DocumentListener</code> for <strong>Curriculum Name</strong> <code>JTextField</code> (which adds the <code>*</code>)</p>

<p><code>ItemStateChangedListener</code> for <strong>Year Level</strong> <code>JComboBox</code> (also adds the <code>*</code>)</p>

<p><code>ItemStateChangedListener</code> for <strong>School Year</strong> <code>JComboBox</code> (also adds the <code>*</code> )</p>

<p>How can I tell SAVE button's <code>actionPerformed</code> instructions to call "only" the stored procedure(s) for components whose state / value was changed?</p>

<p>Like,</p>

<pre><code>private void SaveJbtnActionPerformed(java.awt.event.ActionEvent evt) {

if(yearlevel was changed)
call updateYearLevel()
else if(curriculumName was changed)
call updateCurriculumName()
else if(schoolyear was changed)
call updateCurriculumSchoolYear() 

}
</code></pre>

<p><a href="https://i.stack.imgur.com/HXdwC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HXdwC.jpg" alt="enter image description here"></a></p>

<p>I'd appreciate any advice or suggestion of what approach is best.</p>

<p>Thanks in advance.</p>