How can you edit a word document with Java?
I'm not familiar with anything standard. It also depends on the version of Word, since various versions use different file formats.
The POI project from Apache is supposed to provide ways to do this:
You can use COM to do that also. Use a Java COM interop library like JACOB (JAVA COM BRIDGE): http://sourceforge.net/projects/jacob-project/
Here is a tutorial using Jacob to talk to MS Word: http://www.land-of-kain.de/docs/jacob/
The other library that looks promising and that will solve the cross-platform problem is J-Interop: http://www.j-interop.org/.
In the past, I've solved problems like this using OpenOffice.org's Java API. It's not exactly lightweight, but the licensing terms are generous and it has the backing of a development community with a vested interest in making sure it can parse whatever weirdness Microsoft inflicts on the Word file format. Might be worth a look.
You could try Docmosis, which allows you to populate or produce word docs from Java. It's based on BlairHippo's suggestion of using the OpenOffice API but without needing to learn the api. JODReports is similar.