telnet is just a character connection to port 25. The standard Java net and io functions are easy to use for this. You only need 20 lines of code or so.
Any 'network programming' example, article, book, etc. will have what you need to get started.
Also there's a whole binary protocol that you can go through at the beginning to negotiate terminal characteristics and such; the telnet protocol is designed so that if one end ignores the negotiation phase, defaults are adopted. But a real telnet library would include all that stuff.