Icon (String urlString) { if (urlString != null) { if (!icons.containsKey(urlString)) { try { URL url = new URL(urlString); Icon i = new ImageIcon(url); icons.put(urlString, i); } catch (MalformedURLException e1) { return null; } } return icons.get(urlString); } else { return null; } }