introtocomputerscience/JavaBankApp

UI does not properly update with changes

Closed this issue · 1 comments

A user has reported a bug via YouTube:

when you insert more than one account and you select one of them, and then you sort them (for example by the Account Number) if you press the delete button (for example) it deletes the wrong one. Also if your sort the items and then select one of them to delete it, it does the same wrong thing.

User responded on YouTube

I found where the error is. For example into the main menu, into the deposit button code, you get the selected row from the table and use the integer value to catch your customer from the arraylist. But as you sort the table you are not sorting the arraylist so for example if you have 2 accounts and you invert their position and you select the first row you are trying to select the second account but in the arraylist you are still getting the one that was in the first position.

I also found another bug in the withdrawal menu. When you make a withdrawal, you are using the method in accounts that throws an exception if there are not sufficient founds but not if you insert a negative value.