home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 April A / Pcwk4a98.iso / Lotus / Beanmach / DATA1.CAB / Sample_Files / samples / newbeans / BlinkingText.jar / BlinkingTextBeanInfo.java < prev    next >
Text File  |  1997-08-01  |  1KB  |  50 lines

  1.  
  2. /** 
  3.  * The only thing we define in the Juggler BeanInfo is a GIF icon.
  4.  */
  5.  
  6. import java.beans.*;
  7.  
  8. public class BlinkingTextBeanInfo extends SimpleBeanInfo
  9. {
  10.  
  11.     static Class beanClass = BlinkingText.class;
  12.  
  13.   public PropertyDescriptor[] getPropertyDescriptors()
  14.     {
  15.         try
  16.         {
  17.             PropertyDescriptor background =    new PropertyDescriptor("background", beanClass);
  18.             PropertyDescriptor foreground =    new PropertyDescriptor("foreground", beanClass);
  19.             PropertyDescriptor font =    new PropertyDescriptor("font", beanClass);
  20.             PropertyDescriptor text = new PropertyDescriptor("text", beanClass);
  21.             PropertyDescriptor speed = new PropertyDescriptor("speed", beanClass);
  22.             PropertyDescriptor autoStart = new PropertyDescriptor("autoStart", beanClass);
  23.  
  24.             PropertyDescriptor rv[] = {background, foreground, font, text, speed, autoStart};
  25.             return rv;
  26.         }
  27.         catch (IntrospectionException e)
  28.         {
  29.             throw new Error(e.toString());
  30.         }
  31.     }
  32.  
  33.   public int getDefaultPropertyIndex()
  34.     {
  35.         // the index for the "text" property
  36.         return 3; 
  37.     }
  38.  
  39.     public java.awt.Image getIcon(int iconKind)
  40.     {
  41.         if (iconKind == BeanInfo.ICON_COLOR_32x32)
  42.         {
  43.             java.awt.Image img = loadImage("blinkingText.gif");
  44.         return img;
  45.         }
  46.         return null;
  47.     }
  48.  
  49. }
  50.