本文整理匯總了Java中org.openide.util.Utilities.mergeImages方法的典型用法代碼示例。如果您正苦於以下問題:Java Utilities.mergeImages方法的具體用法?Java Utilities.mergeImages怎麽用?Java Utilities.mergeImages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openide.util.Utilities
的用法示例。
在下文中一共展示了Utilities.mergeImages方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: mergeIcons
import org.openide.util.Utilities; //導入方法依賴的package包/類
private static Image mergeIcons(FileObject fo) throws IOException {
int count = ((Integer)fo.getAttribute("iconCount")).intValue();
if (count < 2) throw new IOException();
URL icon1 = (URL)fo.getAttribute("icon1");
System.out.println("Loading " + icon1 + " just to be sure...");
// Make sure it is really loadable:
icon1.openConnection().getInputStream().close();
Image img = Toolkit.getDefaultToolkit().getImage(icon1);
for (int i = 2; i <= count; i++) {
URL iconn = (URL)fo.getAttribute("icon" + i);
System.out.println("Loading " + iconn + " just to be sure...");
iconn.openConnection().getInputStream().close();
Image added = Toolkit.getDefaultToolkit().getImage(iconn);
int x = ((Integer)fo.getAttribute("iconx" + count)).intValue();
int y = ((Integer)fo.getAttribute("icony" + count)).intValue();
img = Utilities.mergeImages(img, added, x, y);
}
return img;
}