title: How to set defined value for each field present in PDF Form using PDFBOX
body: <p>How to set defined value for each and every field present in PDF Form,
  Consider that I have 5 fields in my PDF form say 2 Text box (First Name and Last Name) two Check box (Check_1,Check_2) , 2 Radio Button(Male,Female) and then at last i have another Text box (Address) , Now I have to define or set a value each and every field say 1 for First Name and 2 for Last Name , 3 for Check_1 and goes on till 7 for Address 
  Below is the piece of code to define the value for each field but I'm facing some issue while setting up value for Radio button fields 
  when it comes to Male and Female field it makes displays "1" for male and female for other fields it displays the correct value </p>
  
  <p>Can any one help me out please ...</p>
  
  <p>Thanks</p>
  
  <pre><code>List FieldTypes = form.getFields();
      PDField pdfFields;
          for (int i = 0; i &lt; FieldTypes.size(); i++) {
  
              pdfFields = (PDField) FieldTypes.get(i);
              String type = null;
  
              if (pdfFields instanceof PDTextbox) {
                  type = "TextBox";
                  String iAsString = Integer.toString(i);
                  pdfFields.setValue(iAsString);
                  System.out.println("Text" + "   "+ pdfFields.getFullyQualifiedName());
               } else if (pdfFields instanceof PDCheckbox) {
                  type = "CheckBox";
                  String iAsString = Integer.toString(i);
                  System.out.println(iAsString);
                  System.out.println("CheckBox" + "   "+ pdfFields.getFullyQualifiedName());
              } else if (pdfFields instanceof PDRadioCollection) {
  
                  List kids = pdfFields.getKids();
                  for (Object kid : kids) {
                        if (kid instanceof PDCheckbox) {
                        PDCheckbox checkbox = (PDCheckbox) kid;
                        String Name = checkbox.getOnValue();
                        String iAsString = Integer.toString(i);
                        System.out.println(iAsString);
                        type = "RadioButton";
                        System.out.println("RadioButton"+"  "+checkbox.getOnValue());
                        }
  
                  }
              }
          }
  </code></pre>