Java Reference
In-Depth Information
L ISTING D.1 Continued
p.load(loader.getResourceAsStream(JNLP_PROPERTIES));
System.setProperties(p);
System.out.println(“jnlp properties loaded.”);
}
} catch (Exception ex) {
System.out.println(“setting JNLP properties: “+ex);
}
}
initializeDefaultResources();
try {
msg = ResourceBundle.getBundle(bundleFilename);
} catch (java.util.MissingResourceException mre) {
msg = null;
System.out.println(“GeneralUtilities (init) Couldn't find any resource
bundle.”);
}
}
/**
* initializes default resources
*/
private void initializeDefaultResources() {
//initializes the empty icon
java.awt.Graphics g = EMPTY_ICON.getImage().getGraphics();
g.drawLine(8,8,16,16);
g.drawLine(8,16,16,8);
}
/**
* return the given class loader
*/
public static ClassLoader getClassLoader(){
if (util==null)
getInstance();
return loader;
D
}
/**
* return resource as an ImageIcon
*/
public static ImageIcon getImageIcon(String name){
if (util==null)
getInstance();
URL res = loader.getResource(name);
Search WWH ::




Custom Search