Java Excel API is an open source java library to read, write and modify Excel spread sheets.
This requires the library jxl-2.6.12.jar to be in classpath.
The following example shows how to add Font Style to a Cell in Excel Spread sheet.
// Create cell font and format
WritableFont cellFont = new WritableFont(WritableFont.TIMES, 16);
cellFont.setColour(Colour.BLUE);
WritableCellFormat cellFormat = new WritableCellFormat(cellFont);
cellFormat.setBackground(Colour.ORANGE);
// Create the label, specifying content and format
Label label = new Label(1, 2, "ABCD", cellFormat);
Label label2 = new Label(1, 4, "XYZ", cellFormat);
sheet.addCell(label);
sheet.addCell(label2);
//Writes out the data held in this workbook in Excel format
workbook.write();
//Close and free allocated memory
workbook.close();
}