I am trying to implement an accounting-related basic scenario but I can’t get the required result. According to my scenario, there is a Journal screen (see attached file) where the user is allowed to enter an amount either in the field “Debit Amount” or “Credit Amount”. When the field “Debit Amount” is filled in by the user, then the field “Credit Amount” should be set to zero while the field “Amount” will be equal to “Debit Amount” value. If the user, enters a value in the field “Credit Amount” , then the field “Debit Amount” should be set to zero and the field “Amount” should have the value minus “Credit Amount”. I tried to implement the aforementioned scenario using the datasource listener ItemPropertyChangeListener for both fields “Debit Amount” & “Credit Amount”. Unfortunately, both fields are set to zero since the listeners are called for both fields!
Do you have any idea about how I could resolve this problem?