Apache POI supports the creation and manipulation of Microsoft Office file formats, principally files created with Excel, Word, and PowerPoint.
Up until the early 2000's, those applications used an increasingly archaic format based on Microsoft's OLE2 standard, which could most easily be recognized by their filename extensions — XLS, DOC, and PPT. Since then, Microsoft has gradually moved over to formats based on Office Open XML (OOXML), with its files having the extensions XLSX, DOCX, and PPTX (note the extra 'X').Apache POI is sadly lumbered with having to support these six formats, which it calls HSSF and XSSF for Excel, HWPF and XWPF for Word, and HSLF and XSLF for PowerPoint. The 'H' prefix is for the OLE formats (and stands for 'Horrible'), while the 'X' is for XML.
All of this complicates coding of course, since you have to decide whether to deal with all the formats, or just OOXML. To be fair, Apache POI hides some of the differences, as illustrated in the Extractor.java and GetThaiData.java examples.
More information on Apache POI:
The rest of this page lists my examples, which I've divided into four groups: 'General', 'Excel', 'Word', and 'PowerPoint'. The 'General' code works with all formats, while the other three focus on the specified application. Within each group, there's usually two examples, one for reading a file, and one for generating a file.
Other links for programming Excel with POI: here, here, here, here, here.
Other links for programming Word with POI: here, here, here, and here.
Other links for programming PowerPoint with POI: here, here, here.
Unzip the file, and place the libs folder in the same directory as the examples and batch files.