BorderType
Inheritance: java.lang.Object
public class BorderType
Specifies sides of a border.
To learn more, visit the Programming with Documents documentation article.
Examples:
Shows how to insert a paragraph with a top border.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Border topBorder = builder.getParagraphFormat().getBorders().getByBorderType(BorderType.TOP);
topBorder.setLineWidth(4.0d);
topBorder.setLineStyle(LineStyle.DASH_SMALL_GAP);
// Set ThemeColor only when LineWidth or LineStyle setted.
topBorder.setThemeColor(ThemeColor.ACCENT_1);
topBorder.setTintAndShade(0.25d);
builder.writeln("Text with a top border.");
doc.save(getArtifactsDir() + "Border.ParagraphTopBorder.docx");
Fields
Field | Description |
---|---|
BOTTOM | Specifies the bottom border of a paragraph or a table cell. |
DIAGONAL_DOWN | Specifies the diagonal border in a table cell. |
DIAGONAL_UP | Specifies the diagonal border in a table cell. |
HORIZONTAL | Specifies the horizontal border between cells in a table or between conforming paragraphs. |
LEFT | Specifies the left border of a paragraph or a table cell. |
NONE | Default value. |
RIGHT | Specifies the right border of a paragraph or a table cell. |
TOP | Specifies the top border of a paragraph or a table cell. |
VERTICAL | Specifies the vertical border between cells in a table. |
length |
Methods
Method | Description |
---|---|
fromName(String borderTypeName) | |
getName(int borderType) | |
getValues() | |
toString(int borderType) |
BOTTOM
public static int BOTTOM
Specifies the bottom border of a paragraph or a table cell.
DIAGONAL_DOWN
public static int DIAGONAL_DOWN
Specifies the diagonal border in a table cell.
DIAGONAL_UP
public static int DIAGONAL_UP
Specifies the diagonal border in a table cell.
HORIZONTAL
public static int HORIZONTAL
Specifies the horizontal border between cells in a table or between conforming paragraphs.
LEFT
public static int LEFT
Specifies the left border of a paragraph or a table cell.
NONE
public static int NONE
Default value.
RIGHT
public static int RIGHT
Specifies the right border of a paragraph or a table cell.
TOP
public static int TOP
Specifies the top border of a paragraph or a table cell.
VERTICAL
public static int VERTICAL
Specifies the vertical border between cells in a table.
length
public static int length
fromName(String borderTypeName)
public static int fromName(String borderTypeName)
Parameters:
Parameter | Type | Description |
---|---|---|
borderTypeName | java.lang.String |
Returns: int
getName(int borderType)
public static String getName(int borderType)
Parameters:
Parameter | Type | Description |
---|---|---|
borderType | int |
Returns: java.lang.String
getValues()
public static int[] getValues()
Returns: int[]
toString(int borderType)
public static String toString(int borderType)
Parameters:
Parameter | Type | Description |
---|---|---|
borderType | int |
Returns: java.lang.String