Excel > JExcel API > How to Add Underline to Cells in Excel Spreadsheet
How to Add Underline to Cells in Excel Spreadsheet
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 underline to a Cell in Excel Spreadsheet.
// Create the label, specifying content and format
Label label = new Label(1, 2, "ABC", getCellFormat(UnderlineStyle.SINGLE));
Label label2 = new Label(1, 4, "ABC", getCellFormat(UnderlineStyle.SINGLE_ACCOUNTING));
Label label3 = new Label(1, 6, "XYZ", getCellFormat(UnderlineStyle.DOUBLE));
Label label4 = new Label(1, 8, "XYZ", getCellFormat(UnderlineStyle.DOUBLE_ACCOUNTING));