Java Reference
In-Depth Information
L ISTING D.1 The GeneralUtilities Class
import javax.swing.ImageIcon;
import java.awt.image.BufferedImage;
import javax.jnlp.UnavailableServiceException;
import javax.jnlp.ServiceManager;
import javax.jnlp.DownloadService;
import javax.jnlp.BasicService;
import java.util.ResourceBundle;
import java.util.Properties;
* Appendix D - general utilities class
* @author Mauro Marinilli
* @version 1.0
public class GeneralUtilities {
private static GeneralUtilities util;
private static ClassLoader loader;
private static BasicService basicService;
private static ImageIcon EMPTY_ICON =
new ImageIcon(new BufferedImage(24,24,BufferedImage.TYPE_INT_RGB));
private ResourceBundle msg;
private static String bundleFilename = “messages”;
private final static String JNLP_PROPERTIES = “”;
* creates the only instance for this singleton class
private GeneralUtilities() {
loader = getClass().getClassLoader();
basicService =
if (basicService==null){
AServiceManagerStub sms = new AServiceManagerStub();
basicService =
try {
Properties p = System.getProperties();
URL up = loader.getResource(JNLP_PROPERTIES);
if (up!=null) {
Search WWH ::

Custom Search