Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.
1 package discRack; 2 3 import java.awt.*; 4 import java.util.*; 5 import java.text.*; 6 import java.net.URL ; 7 import javax.accessibility.*; 8 9 16 public class ResourceManager { 17 private static final String resourcePath= 18 "discRack.resources.DiscRack"; 19 20 public static ResourceBundle defaultResource; 21 22 23 static { 24 try { 25 defaultResource = ResourceBundle. 26 getBundle(resourcePath); 27 } 28 catch (MissingResourceException mre) { 29 System.err.println(resourcePath+".properties not found"); 30 System.exit(1); 31 } 32 } 33 34 44 public static String getResourceString (String nm) { 45 String str; 46 try { 47 str=defaultResource.getString(nm); 48 } catch (MissingResourceException mre1) { 49 str = null; 50 } 51 return str; 52 } 53 54 60 public static URL getResource (String key) { 61 String name = getResourceString(key); 62 if (name != null) { 63 URL url = ResourceManager.class.getClassLoader().getResource(name); 64 return url; 65 } 66 return null; 67 } 68 }
| Popular Tags
|