/** * Retrieve an image icon resource. * * @param resourceName * the name of the resource * @return an image icon, or null if the specified resource could not be * found */ public static ImageIcon getImageIcon(String resourceName) { ImageIcon result = null; URL resourceURL = getURL(resourceName); if (resourceURL != null) { result = new ImageIcon(resourceURL); } return result; }
/** * Retrieve an image resource * * @param resourceName * the name of the resource * @return an image, or null if the specified resource could not be found */ public static BufferedImage getImage(String resourceName) { BufferedImage result = null; URL url = getURL(resourceName); try { result = ImageIO.read(url); } catch (IOException e) { result = null; } return result; }
/** * Retrieve a properties resource. * * @param resourceName * the name of the resource * @return a Properties object representing the contents of the resource, or * null if the specified resource could not be found * @throws IOException */ public static Properties getProperties(String resourceName) throws IOException { URL resourceURL = getURL(resourceName); if (resourceURL != null) { InputStream in = resourceURL.openStream(); try { Properties result = new Properties(); result.load(in); return result; } finally { in.close(); } } return null; }
private void createNavigationModel() { boolean first = true; for (String navigationModelLocation : navigationModelLocations) { NavigationXmlParser parser = new NavigationXmlParser(); if (first) { parser.parseInto(this, ResourceUtil.getURL(navigationModelLocation)); first = false; } else { addModel(parser.parse(ResourceUtil.getURL(navigationModelLocation))); } } }
private void createNavigationModel() { boolean first = true; for (String navigationModelLocation : navigationModelLocations) { NavigationXmlParser parser = new NavigationXmlParser(); if (first) { parser.parseInto(this, ResourceUtil.getURL(navigationModelLocation)); first = false; } else { addModel(parser.parse(ResourceUtil.getURL(navigationModelLocation))); } } }