BeanInfo: getEventSetDescriptors() : BeanInfo « java.beans « Java by API






BeanInfo: getEventSetDescriptors()

  

import java.beans.BeanInfo;
import java.beans.EventSetDescriptor;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;

public class Main {
  public static void main(String args[]) {
    try {
      Class c = Class.forName("Colors");
      BeanInfo beanInfo = Introspector.getBeanInfo(c);

      System.out.println("Properties:");
      PropertyDescriptor propertyDescriptor[] = beanInfo.getPropertyDescriptors();
      for (int i = 0; i < propertyDescriptor.length; i++) {
        System.out.println("\t" + propertyDescriptor[i].getName());
      }

      System.out.println("Events:");
      EventSetDescriptor eventSetDescriptor[] = beanInfo.getEventSetDescriptors();
      for (int i = 0; i < eventSetDescriptor.length; i++) {
        System.out.println("\t" + eventSetDescriptor[i].getName());
      }
    } catch (Exception e) {
      System.out.println("Exception caught. " + e);
    }
  }
}

   
    
  








Related examples in the same category

1.BeanInfo: getPropertyDescriptors()