@Override public void setBulletStyle(Object... styles) { if (styles.length == 0) { setBullet(false); } else { setBullet(true); for (Object ostyle : styles) { if (ostyle instanceof Number) { setBulletSize(((Number)ostyle).doubleValue()); } else if (ostyle instanceof Color) { setBulletColor((Color)ostyle); } else if (ostyle instanceof Character) { setBulletChar((Character)ostyle); } else if (ostyle instanceof String) { setBulletFont((String)ostyle); } else if (ostyle instanceof AutoNumberingScheme) { throw new HSLFException("setting bullet auto-numberin scheme for HSLF not supported ... yet"); } } } }
public static void main(String[] args) throws IOException { try (HSLFSlideShow ppt = new HSLFSlideShow()) { HSLFSlide slide = ppt.createSlide(); HSLFTextBox shape = new HSLFTextBox(); HSLFTextParagraph rt = shape.getTextParagraphs().get(0); rt.getTextRuns().get(0).setFontSize(42d); rt.setBullet(true); rt.setIndent(0d); //bullet offset rt.setLeftMargin(50d); //text offset (should be greater than bullet offset) rt.setBulletChar('\u263A'); //bullet character shape.setText( "January\r" + "February\r" + "March\r" + "April"); slide.addShape(shape); shape.setAnchor(new java.awt.Rectangle(50, 50, 500, 300)); //position of the text box in the slide slide.addShape(shape); try (FileOutputStream out = new FileOutputStream("bullets.ppt")) { ppt.write(out); } } } }