Tons of free source code of chat applications are available on the web. I also wrote a simple chat application in Java years ago. In this program, you can send not only messages but also images. Though it is an old code, hope it may be useful for someone to learn. Also StackOverFlow,GeeksforGeeks etc sites are also good platform to learn coding. Happy coding 🙂