Map<Number,Icon> iconMap = new HashMap<Number,Icon>();
for(int i=0; i<vertices.length; i++) {
String name = "/images/topic"+iconNames[i]+".gif";
try {
Icon icon =
new LayeredIcon(new ImageIcon(LensVertexImageShaperDemo.class.getResource(name)).getImage());
iconMap.put(vertices[i], icon);
} catch(Exception ex) {
System.err.println("You need slashdoticons.jar in your classpath to see the image "+name);
}
}