I have a chat application built in Java. The chat app stores a log of the user Jimmy's chats locally on his machine.

I want this chat log to be encrypted so if someone uses the computer (authorized or unauthorized) he cannot simply read all of Jimmy's chats. I would like Jimmy's chats to only be readable when Jimmy is logged in. As soon as he logs out, the chats should be encrypted and unreadable. 

Any ideas on how this sort of scheme could be implemented?