import java.beans.*; import java.awt.*; public class BeanWithIconBeanInfo extends SimpleBeanInfo { private final String ICON_FILENAME = "BeanWithIcon.gif"; //------------------------------------------------------------------- // Overridden BeanInfo.getIcon() to simply direct tools to our icon. //------------------------------------------------------------------- public Image getIcon(int iconKind) { if ( iconKind == BeanInfo.ICON_COLOR_16x16 ) { return loadImage(ICON_FILENAME); } else { System.out.println("BeanWithIcon only has a 16x16 icon."); return null; } } } // End of Class BeanWithIconBeanInfo