FileDocCategorySizeDatePackage
SampleField.javaAPI DocExample1441Tue Dec 12 18:58:48 GMT 2000None

SampleField

public class SampleField extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

      GridBagConstraints g = new GridBagConstraints();
      printFieldNames(g);
   
static voidprintFieldNames(java.lang.Object o)

      Class c = o.getClass();
      Field[] publicFields = c.getFields();
      for (int i = 0; i < publicFields.length; i++) {
         String fieldName = publicFields[i].getName();
         Class typeClass = publicFields[i].getType();
         String fieldType = typeClass.getName();
         System.out.println("Name: " + fieldName + 
           ", Type: " + fieldType);
         }