In this iText 7 example, we'll change the properties and the value of a text field:
public void manipulatePdf(String src, String dest) throws IOException {
PdfReader reader = new PdfReader(src);
PdfDocument pdf = new PdfDocument(reader, new PdfWriter(dest));
PdfAcroForm form = PdfAcroForm.getAcroForm(pdf, true);
PdfFormField tf = form.getFormFields().get("text");
tf.setBorderColor(Color.RED)
.setColor(Color.BLUE)
.setFontSize(14)
.setValue("Field Text");
pdf.close();
}
Source: developers.itextpdf.com