List of usage examples for org.apache.poi.hssf.usermodel HSSFTextbox setLineStyle
public void setLineStyle(int lineStyle)
From source file:poi.hssf.usermodel.examples.OfficeDrawing.java
License:Apache License
private static void drawSheet4(HSSFSheet sheet4, HSSFWorkbook wb) { // Create the drawing patriarch. This is the top level container for // all shapes. This will clear out any existing shapes for that sheet. HSSFPatriarch patriarch = sheet4.createDrawingPatriarch(); // Create a couple of textboxes HSSFTextbox textbox1 = patriarch/*from www. j a v a 2 s .co m*/ .createTextbox(new HSSFClientAnchor(0, 0, 0, 0, (short) 1, 1, (short) 2, 2)); textbox1.setString(new HSSFRichTextString("This is a test")); HSSFTextbox textbox2 = patriarch .createTextbox(new HSSFClientAnchor(0, 0, 900, 100, (short) 3, 3, (short) 3, 4)); textbox2.setString(new HSSFRichTextString("Woo")); textbox2.setFillColor(200, 0, 0); textbox2.setLineStyle(HSSFSimpleShape.LINESTYLE_DOTGEL); // Create third one with some fancy font styling. HSSFTextbox textbox3 = patriarch .createTextbox(new HSSFClientAnchor(0, 0, 900, 100, (short) 4, 4, (short) 5, 4 + 1)); HSSFFont font = wb.createFont(); font.setItalic(true); font.setUnderline(HSSFFont.U_DOUBLE); HSSFRichTextString string = new HSSFRichTextString("Woo!!!"); string.applyFont(2, 5, font); textbox3.setString(string); textbox3.setFillColor(0x08000030); textbox3.setLineStyle(HSSFSimpleShape.LINESTYLE_NONE); // no line around the textbox. textbox3.setNoFill(true); // make it transparent }