Do a google search for java io and java encryption. Should be pretty straight forward. Once you have done some research and tried coding, feel free to ask some specific questions if you get stuck. Good luck.
d coding, feel free to ask some specific questions
Theres a whole lot of theory and multiple methods of encryption and decryption, including the most efficient to safest and so on. So your question is kind of vague. You also dont state whether you want to only learn how to encrypt images or whether you just need the fucntionality of encrypting without learning how to write an ecrypter. If it is the latter then there are librarys native in java to provide such functionality :
however, its not exactly an extensive example or by any means reveal the full use of what you'd really want. Id recommend mainly studying the crypto package and its methods and become familiar with some of the standard encryption algorithms if you are really interested in such things, if you just need the methods existing in java its probably not an area you'd want to spend a lot of time studying.