Example usage for java.util Locale setDefault

List of usage examples for java.util Locale setDefault

Introduction

In this page you can find the example usage for java.util Locale setDefault.

Prototype

public static synchronized void setDefault(Locale newLocale) 

Source Link

Document

Sets the default locale for this instance of the Java Virtual Machine.

Usage

From source file:edu.ku.brc.specify.utilapps.BuildSampleDatabase.java

/**
 * @param args/*from   w w w  . j a v a2 s. com*/
 */
public static void main(final String[] args) {
    System.setProperty(DBMSUserMgr.factoryName, "edu.ku.brc.dbsupport.MySQLDMBSUserMgr");
    try {
        ResourceBundle.getBundle("resources", Locale.getDefault()); //$NON-NLS-1$

    } catch (MissingResourceException ex) {
        Locale.setDefault(Locale.ENGLISH);
        setResourceLocale(Locale.ENGLISH);
    }

    new HiddenTableMgr();
    try {
        if (!System.getProperty("os.name").equals("Mac OS X")) {
            UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
            PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

    if (StringUtils.isEmpty(getAppName())) {
        setAppName("Specify");
    }

    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            BuildSampleDatabase builder = new BuildSampleDatabase();
            builder.buildSetup(args);
        }
    });
}

From source file:com.zoffcc.applications.zanavi.Navit.java

private static void activatePrefs_loc() {
    // if (Navit.METHOD_DEBUG) Navit.my_func_name(0);

    // creating locale
    if (!p.PREF_navit_lang.equals("*DEFAULT*")) {
        Locale locale2 = null;//  www .j av a 2  s . c  om
        if (p.PREF_navit_lang.contains("_")) {
            String _lang = p.PREF_navit_lang.split("_", 2)[0];
            String _country = p.PREF_navit_lang.split("_", 2)[1];
            System.out.println("l=" + _lang + " c=" + _country);
            locale2 = new Locale(_lang, _country);
        } else {
            locale2 = new Locale(p.PREF_navit_lang);
        }
        Locale.setDefault(locale2);
        Configuration config2 = new Configuration();
        config2.locale = locale2;
        // updating locale
        getBaseContext_.getResources().updateConfiguration(config2, null);
    }

    // if (Navit.METHOD_DEBUG) Navit.my_func_name(1);
}