本文整理匯總了Java中java.beans.BeanInfo.ICON_MONO_32x32方法的典型用法代碼示例。如果您正苦於以下問題:Java BeanInfo.ICON_MONO_32x32方法的具體用法?Java BeanInfo.ICON_MONO_32x32怎麽用?Java BeanInfo.ICON_MONO_32x32使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.beans.BeanInfo
的用法示例。
在下文中一共展示了BeanInfo.ICON_MONO_32x32方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getIcon
import java.beans.BeanInfo; //導入方法依賴的package包/類
@Override
public Image getIcon(int type) {
Image icon = null;
if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) {
if (icon16 == null) {
icon16 = _getIcon(type, icon16URL);
if (icon16 == null)
icon16 = ImageUtilities.loadImage("org/netbeans/modules/palette/resources/unknown16.gif"); // NOI18N
}
icon = icon16;
}
else if (type == BeanInfo.ICON_COLOR_32x32 || type == BeanInfo.ICON_MONO_32x32) {
if (icon32 == null) {
icon32 = _getIcon(type, icon32URL);
if (icon32 == null)
icon32 = ImageUtilities.loadImage("org/netbeans/modules/palette/resources/unknown32.gif"); // NOI18N
}
icon = icon32;
}
return icon;
}
示例2: loadIcon
import java.beans.BeanInfo; //導入方法依賴的package包/類
public static Image loadIcon(SaasGroup saasGroup, int type) {
String path = saasGroup.getIcon16Path();
if (type == BeanInfo.ICON_COLOR_32x32 || type == BeanInfo.ICON_MONO_32x32) {
path = saasGroup.getIcon32Path();
}
if (path != null) {
URL url = Thread.currentThread().getContextClassLoader().getResource(path);
if (url != null) {
return new ImageIcon(url).getImage();
}
return ImageUtilities.loadImage(path);
}
return null;
}