Example: The following example shows how to create an List Box and Add it to the page.
import com.cete.dynamicpdf.*; import com.cete.dynamicpdf.pageelements.forms.*; import com.cete.dynamicpdf.text.*; public class MyClass{ public static void main(String args[]) { // Create a PDF Document Document document = new Document(); // Create a PDF Page Page page = new Page( PageSize.LETTER ); // Create an List Box ListBox listBox = new ListBox( "list", 5, 2, 100, 150 ); OpenTypeFont myFont = new OpenTypeFont("fontname"); listBox.setFont(myFont); listBox.getItems().add("One",true); listBox.getItems().add("Two","ExportTwo", true ); listBox.getItems().add("Three"); listBox.getItems().add("Four"); listBox.getItems().add("Five"); listBox.setBackgroundColor( RgbColor.getAliceBlue() ); listBox.setBorderColor( RgbColor.getDarkMagenta() ); listBox.setBorderStyle( BorderStyle.DASHED ); listBox.setMultiselect( true ); listBox.setToolTip( "Select" ); // Add the List Box to the page page.getElements().add( listBox ); // Add pages to the document document.getPages().add( page ); // Save the PDF document document.draw("[PhysicalPath]/MyDocument.pdf"); } }