You have opened file only for reading:
RandomAccessFile("files/bank.txt", "r");
you should open it with:
new RandomAccessFile("files/bank.txt", "rws");
which opens for reading and writing, as with "rw", and also require that every update to the file's content or metadata be written synchronously to the underlying storage device.
or with:
new RandomAccessFile("files/bank.txt", "rwd");
which opens for reading and writing, as with "rw", and also require that every update to the file's content be written synchronously to the underlying storage device.