In this program we are going to make an excel sheet and
set the fonts of text values, set its size. We can also set the name of the
The packages we need to import are java.io.*,java.util.* ,org.apache.poi.hssf.usermodel.HSSFSheet,org.apache.poi. hssf. usermodel. HSSFCellStyle, org.apache.poi.usermodel.HSSFRow, org.apache.poi.usermodel.HSSFCell , org.apache.poi.hssf.usermodel. HSSFWorkbook and org.apache.poi.hssf.usermodel.HSSFFont.
extends java.lang.Object and is used to represent a font used in workbook.
This also provides various methods to set various font properties on
In this example we are using following key points:
This method is used to set the height of the text.
This method is used to set the font name.
This method is used the to set text as Italic.
This method is used to set strikeout on text.
This method is used to set font on cell style sheet.
The code of the program is given below:
The output of the program is given below:
If you enjoyed this post then why not add us on Google+? Add us to your Circles
Liked it! Share this Tutorial