Form form = doc.createForm("Test Form");
Paragraph.newParagraph(doc);
Paragraph.newParagraph(doc);
Paragraph.newParagraph(doc);
Paragraph para = Paragraph.newParagraph(doc);
FormControl dateField = form.createDateField(para, fieldRtg,
"DateField", "20120715");
((DateField) dateField).setSpinButonVisible(true);
((DateField) dateField).setDropDownVisible(true);
((DateField) dateField).formatDate("yy/MM/dd", Locale.US);
Paragraph.newParagraph(doc);
Paragraph.newParagraph(doc);
Paragraph.newParagraph(doc);
para = Paragraph.newParagraph(doc);
FormControl timeField = form.createTimeField(para, fieldRtg,
"TimeField", "15234000");
((TimeField) timeField).setSpinButonVisible(true);
((TimeField) timeField).formatTime("HH:mm a", Locale.US);
Paragraph.newParagraph(doc);
Paragraph.newParagraph(doc);
Paragraph.newParagraph(doc);
para = Paragraph.newParagraph(doc);
FormControl numericField = form.createNumericField(para, fieldRtg,
"NumericField", "-154.3567");
((NumericField) numericField).setDecimalAccuracy(3);
((NumericField) numericField).setSpinButonVisible(true);
Paragraph.newParagraph(doc);
Paragraph.newParagraph(doc);
Paragraph.newParagraph(doc);
para = Paragraph.newParagraph(doc);
FormControl patternField = form.createPatternField(para, fieldRtg,
"PatternField", "12345");
((PatternField) patternField).setLiteralMask("###");
((PatternField) patternField).setEditMask("abc");
((PatternField) patternField).setSpinButonVisible(true);
Paragraph.newParagraph(doc);
Paragraph.newParagraph(doc);
Paragraph.newParagraph(doc);
para = Paragraph.newParagraph(doc);
para.appendTextContent("insert currency field here:");
FormControl currencyField = form.createCurrencyField(para,
fieldRtg, "CurrencyField", "135.467");
((CurrencyField) currencyField).setCurrencySymbol("CNY");
((CurrencyField) currencyField).setDecimalAccuracy(4);
((CurrencyField) currencyField).setSpinButonVisible(true);