|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Methods for managing the loading of images and items from resource bundles.
Method Summary | |
String |
getDefaultBundle()
Returns the default bundle for the application's resource manager. |
Locale |
getLocale()
Returns the current Locale being used by this resource manager. |
String |
getString(String bundle,
String key)
Loads a String associated with the passed key from the named resource bundle. |
String |
getString(String bundle,
String key,
Locale locale)
Loads a String associated with the passed key from the named resource bundle based on the passed Locale. |
String |
getString(String bundle,
String key,
Locale locale,
ClassLoader classLoader)
Loads a String associated with the passed key from the named resource bundle based on the passed Locale. |
ImageIcon |
loadImageIcon(String iconName)
Loads an image as an ImageIcon. |
ImageIcon |
loadImageIcon(String iconName,
ClassLoader classLoader)
Loads an image as an ImageIcon. |
ImageIcon |
loadImageIcon(String bundle,
String key)
Loads an image as an ImageIcon after getting the fully qualified package name from a resource bundle. |
ImageIcon |
loadImageIcon(String bundle,
String key,
Locale locale)
Loads an image as an ImageIcon after getting the fully qualified package name from a resource bundle based on the passed Locale. |
void |
setLocale(Locale locale)
Sets the Locale to be used by this resource manager. |
Method Detail |
public String getDefaultBundle()
public Locale getLocale()
public void setLocale(Locale locale)
locale
- Localepublic ImageIcon loadImageIcon(String iconName)
Note that this method assumes the ClassLoader to be used for loading the image is the same as the ClassLoader for the implementation class. If you are loading an image from a jar file that was loaded at runtime, you will need to use the signature that takes a ClassLoader argument.
iconName
- String
public ImageIcon loadImageIcon(String iconName, ClassLoader classLoader)
This method also takes a ClassLoader. If you are trying to load images from a jar that was not on the initial classpath, you must pass in the classloader for the jar file.
iconName
- StringclassLoader
- ClassLoader
public ImageIcon loadImageIcon(String bundle, String key)
bundle
- Stringkey
- String
public ImageIcon loadImageIcon(String bundle, String key, Locale locale)
bundle
- Stringkey
- Stringlocale
- Locale
public String getString(String bundle, String key)
bundle
- Stringkey
- String
public String getString(String bundle, String key, Locale locale)
bundle
- Stringkey
- Stringlocale
- Locale
public String getString(String bundle, String key, Locale locale, ClassLoader classLoader)
This method also takes a ClassLoader. If you are trying to load strings from a properties file in a jar that was not on the initial classpath, you must pass in the classloader for the jar file.
bundle
- Stringkey
- Stringlocale
- LocaleclassLoader
- ClassLoader
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |