import org.apache.poi.hslf.HSLFSlideShow;
import org.apache.poi.hslf.model.Slide;
import org.apache.poi.hslf.usermodel.SlideShow;
import org.apache.poi.hslf.usermodel.RichTextRun;
import java.io.*;
import java.awt.*;
import org.apache.poi.hslf.model.TextBox;
class workingWithTextFormat
{
	public static void main(String a[])
	{
	try
	{   SlideShow slideShow = new SlideShow();
       Slide slide = slideShow.createSlide();
	  
	   TextBox txt = new TextBox();
        txt.setText("Rajesh Kumar!");
        txt.setAnchor(new java.awt.Rectangle(300, 100, 200, 50));
        RichTextRun richTextRun = txt.getTextRun().getRichTextRuns()[0];
        richTextRun.setFontSize(45);
        richTextRun.setFontName("Arial");
        richTextRun.setBold(true);
        richTextRun.setItalic(true);
        richTextRun.setUnderlined(true);
        richTextRun.setFontColor(Color.red);
        richTextRun.setAlignment(TextBox.AlignRight);
        slide.addShape(txt);
        FileOutputStream out = new FileOutputStream("richTextRun.ppt");
        slideShow.write(out);
        out.close();
	}catch(Exception e){}
	}}