Since no one's answered you - your best bet is to look at Jabber (www.jabber.org) and use one of the Java APIs for interfacing with their network. There are means, using their code, to interface with MSN and Yahoo!. Or so I believe, at any rate.
Theodore Jonathan Casser
SCJP/SCSNI/SCBCD/SCWCD/SCDJWS/SCMAD/SCEA/MCTS/MCPD... and so many more letters than you can shake a stick at!