FaqFormCustomComponentIcon
How can I define an icon for my component in the palette?
It is very simple. You need to provide a BeanInfo class for your component and implement getIcon method. Here is a very simple example:
package com.me.beans;
public class MyComponentBeanInfo extends java.beans.SimpleBeanInfo {
public java.awt.Image getIcon(int iconKind) {
return loadImage("/com/me/beans/cool_icon.gif");
}
}
Note: You need to follow the convention about naming the BeanInfo class: e.g. for bean class named MyComponent it is MyComponentBeanInfo. Both classes should be in the same package.
Applies to: All NetBeans versions
Platforms: All
