Setting font size etc.

I have this code and i have been working on this for hours. the program runs properly but it just wont work. its just setting the run size.
here's the code.
this is just the part of the code where i added the paragraph and all. it displays the "sample date" but the size didn't change. thanks in advance
here's the code.
- Code: Select all
P pDate = factory.createP();
R rDate = factory.createR();
RPr sample = factory.createRPr();
HpsMeasure size = new HpsMeasure();
size.setVal(BigInteger.valueOf(21));
sample.setSz(size);
rDate.setRPr(sample);
rDate.getContent().add(wordMLPackage.getMainDocumentPart().createParagraphOfText("sample date"));
pDate.getContent().add(rDate);
this is just the part of the code where i added the paragraph and all. it displays the "sample date" but the size didn't change. thanks in advance