com.cete.dynamicpdf.pageelements.forms
Class Combobox



Example: The following example shows how to create an Combo Box and Add it to the page.

import com.cete.dynamicpdf.*;
import com.cete.dynamicpdf.pageelements.forms.ComboBox;
 
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 Combo Box
        ComboBox comboBox = new ComboBox( "combo", 50, 75, 150, 25 );        
        comboBox.getItems().add( "One" );
        comboBox.getItems().add( "Two" );
        comboBox.getItems().add( "Three" );
        comboBox.getItems().add( "Four" );
        comboBox.getItems().add( "Five" );
        comboBox.setBackgroundColor( RgbColor.getAliceBlue() );
        comboBox.setBorderColor( RgbColor.getDarkMagenta());
        comboBox.getItems().getChoiceItem(0).setSelected(true);
        comboBox.setEditable( true );
        comboBox.setToolTip( "Select" );
        
        // Add the Combo Box to the page
        page.getElements().add( comboBox );
        
        // Add pages to the document
        document.getPages().add( page );
        
        // Save the PDF document
        document.draw("[PhysicalPath]/MyDocument.pdf");
    }
 }