How to compare JTable with file : I have two tables one inventory and another invoice. My inventory is connected to a .dat file which writes and reads it data from the file. I want to compare my invoice table with the elements of the inventory which is stored in the file if match is not it prompts the user to add this item to your inventory. 