setting line style
In this program we are going to create a sheet then create
oval then after set style of line and color.
Code description
The package we need to import is java.io.*,java.util.* ,org.apache.poi.hssf.usermodel.HSSFSheet,org.apache.poi.hssf.usermodel. HSSFPrintSetup, org.apache.poi.hssf.usermodel.HSSFPatriarch,org.apache.poi.hssf.usermodel.HSSFClientAnchor,org.apache. poi.hssf.usermodel.HSSFSimpleShape
and org.apache.poi.hssf.usermodel. HSSFWorkbook.
The method used in this example shift row
setLineWidth(int lineWidth):
This method is used to set the width of the liine.The value is coresponding 1pt=12700
or LINEWIDTH_ONE_PT
setLineStyle(int lineStyle):
This method is used to set the line style.
setLineStyleColor(int lineStyleColor):
This method is used to set color to the lines of this shape.
setLineStyleColor(int red,int green,int blue)
The color applied to the lines of this shape.
You can be used the following fields for color style
static int LINESTYLE_DASHDOTDOTSYS
static int LINESTYLE_DASHDOTGEL
static int LINESTYLE_DASHDOTSYS
static int LINESTYLE_DASHGEL
static int LINESTYLE_DASHSYS
static int LINESTYLE_DOTGEL
static int LINESTYLE_DOTSYS
static int LINESTYLE_LONGDASHDOTDOTGEL
static int LINESTYLE_LONGDASHDOTGEL
static int LINESTYLE_LONGDASHGEL
static int LINESTYLE_NONE
static int LINESTYLE_SOLID
static int LINEWIDTH_DEFAULT
static int LINEWIDTH_ONE_PT
The code of the program is given below:
<%@ page import="org.apache.poi.hssf.usermodel.HSSFSheet"%>
|
The output of the program is given below: