This example displays the type of the first field.
TextFields fields = document.getFields(); TextField field = fields.item(1); System.out.println(field.getType());
Related information
Type property