Try using JaWin. It is available at http://jawinproject.sourceforge.net/jawin.html. The example which you require is present in demos folder of the downloaded package. Hope this solves your problem .
POI support is good for excel. It supports basic functionality of word and powerpoint. Depending on your requirement you can also have a look at openoffice .
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
Gift giving made easy with the permaculture playing cards