Java Code Examples for java.awt.Component#getLocale()

The following examples show how to use java.awt.Component#getLocale() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JOptionInput.java    From jeveassets with GNU General Public License v2.0 4 votes vote down vote up
private static String getString(Object key, Component c) {
	Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
	return UIManager.getString(key, l);
}
 
Example 2
Source File: UIManager.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 3
Source File: UIManager.java    From jdk8u-dev-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 4
Source File: UIManager.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 5
Source File: UIManager.java    From jdk8u_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 6
Source File: UIManager.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 7
Source File: UIManager.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 8
Source File: UIManager.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 9
Source File: UIManager.java    From Java8CN with Apache License 2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 10
Source File: UIManager.java    From jdk1.8-source-analysis with Apache License 2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 11
Source File: UIManager.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 12
Source File: UIManager.java    From Bytecoder with Apache License 2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 13
Source File: UIManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 14
Source File: UIManager.java    From openjdk-jdk8u with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 15
Source File: UIManager.java    From JDKSourceCode1.8 with MIT License 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 16
Source File: UIManager.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 17
Source File: UIManager.java    From TencentKona-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 18
Source File: UIManager.java    From dragonwell8_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}