Java Code Examples for javax.swing.JComponent#setDefaultLocale()

The following examples show how to use javax.swing.JComponent#setDefaultLocale() . These examples are extracted from open source projects. 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
public static void main(String[] args) {
    Locale reservedLocale = Locale.getDefault();
    try {
        // it affects Swing because it is not initialized
        Locale.setDefault(Locale.KOREAN);
        validate(KOREAN, create());

        // it does not affect Swing because it is initialized
        Locale.setDefault(Locale.CANADA);
        validate(KOREAN, create());

        // it definitely should affect Swing
        JComponent.setDefaultLocale(Locale.FRENCH);
        validate(FRENCH, create());
    } finally {
        // restore the reserved locale
        Locale.setDefault(reservedLocale);
    }
}
 
Example 2
public static void main(String[] args) {
    Locale reservedLocale = Locale.getDefault();
    try {
        // it affects Swing because it is not initialized
        Locale.setDefault(Locale.KOREAN);
        validate(KOREAN, create());

        // it does not affect Swing because it is initialized
        Locale.setDefault(Locale.CANADA);
        validate(KOREAN, create());

        // it definitely should affect Swing
        JComponent.setDefaultLocale(Locale.FRENCH);
        validate(FRENCH, create());
    } finally {
        // restore the reserved locale
        Locale.setDefault(reservedLocale);
    }
}
 
Example 3
public static void main(String[] args) {
    Locale reservedLocale = Locale.getDefault();
    try {
        // it affects Swing because it is not initialized
        Locale.setDefault(Locale.KOREAN);
        validate(KOREAN, create());

        // it does not affect Swing because it is initialized
        Locale.setDefault(Locale.CANADA);
        validate(KOREAN, create());

        // it definitely should affect Swing
        JComponent.setDefaultLocale(Locale.FRENCH);
        validate(FRENCH, create());
    } finally {
        // restore the reserved locale
        Locale.setDefault(reservedLocale);
    }
}
 
Example 4
public static void main(String[] args) {
    Locale reservedLocale = Locale.getDefault();
    try {
        // it affects Swing because it is not initialized
        Locale.setDefault(Locale.KOREAN);
        validate(KOREAN, create());

        // it does not affect Swing because it is initialized
        Locale.setDefault(Locale.CANADA);
        validate(KOREAN, create());

        // it definitely should affect Swing
        JComponent.setDefaultLocale(Locale.FRENCH);
        validate(FRENCH, create());
    } finally {
        // restore the reserved locale
        Locale.setDefault(reservedLocale);
    }
}
 
Example 5
public static void main(String[] args) {
    Locale reservedLocale = Locale.getDefault();
    try {
        // it affects Swing because it is not initialized
        Locale.setDefault(Locale.KOREAN);
        validate(KOREAN, create());

        // it does not affect Swing because it is initialized
        Locale.setDefault(Locale.CANADA);
        validate(KOREAN, create());

        // it definitely should affect Swing
        JComponent.setDefaultLocale(Locale.FRENCH);
        validate(FRENCH, create());
    } finally {
        // restore the reserved locale
        Locale.setDefault(reservedLocale);
    }
}
 
Example 6
public static void main(String[] args) {
    Locale reservedLocale = Locale.getDefault();
    try {
        // it affects Swing because it is not initialized
        Locale.setDefault(Locale.KOREAN);
        validate(KOREAN, create());

        // it does not affect Swing because it is initialized
        Locale.setDefault(Locale.CANADA);
        validate(KOREAN, create());

        // it definitely should affect Swing
        JComponent.setDefaultLocale(Locale.FRENCH);
        validate(FRENCH, create());
    } finally {
        // restore the reserved locale
        Locale.setDefault(reservedLocale);
    }
}
 
Example 7
public static void main(String[] args) {
    Locale reservedLocale = Locale.getDefault();
    try {
        // it affects Swing because it is not initialized
        Locale.setDefault(Locale.KOREAN);
        validate(KOREAN, create());

        // it does not affect Swing because it is initialized
        Locale.setDefault(Locale.CANADA);
        validate(KOREAN, create());

        // it definitely should affect Swing
        JComponent.setDefaultLocale(Locale.FRENCH);
        validate(FRENCH, create());
    } finally {
        // restore the reserved locale
        Locale.setDefault(reservedLocale);
    }
}
 
Example 8
Source Project: hottub   File: Test6524757.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {
    Locale reservedLocale = Locale.getDefault();
    try {
        // it affects Swing because it is not initialized
        Locale.setDefault(Locale.KOREAN);
        validate(KOREAN, create());

        // it does not affect Swing because it is initialized
        Locale.setDefault(Locale.CANADA);
        validate(KOREAN, create());

        // it definitely should affect Swing
        JComponent.setDefaultLocale(Locale.FRENCH);
        validate(FRENCH, create());
    } finally {
        // restore the reserved locale
        Locale.setDefault(reservedLocale);
    }
}
 
Example 9
public static void main(String[] args) {
    Locale reservedLocale = Locale.getDefault();
    try {
        // it affects Swing because it is not initialized
        Locale.setDefault(Locale.KOREAN);
        validate(KOREAN, create());

        // it does not affect Swing because it is initialized
        Locale.setDefault(Locale.CANADA);
        validate(KOREAN, create());

        // it definitely should affect Swing
        JComponent.setDefaultLocale(Locale.FRENCH);
        validate(FRENCH, create());
    } finally {
        // restore the reserved locale
        Locale.setDefault(reservedLocale);
    }
}
 
Example 10
public static void main(String[] args) {
    Locale reservedLocale = Locale.getDefault();
    try {
        // it affects Swing because it is not initialized
        Locale.setDefault(Locale.KOREAN);
        validate(KOREAN, create());

        // it does not affect Swing because it is initialized
        Locale.setDefault(Locale.CANADA);
        validate(KOREAN, create());

        // it definitely should affect Swing
        JComponent.setDefaultLocale(Locale.FRENCH);
        validate(FRENCH, create());
    } finally {
        // restore the reserved locale
        Locale.setDefault(reservedLocale);
    }
}
 
Example 11
public static void main(String[] args) {
    Locale reservedLocale = Locale.getDefault();
    try {
        // it affects Swing because it is not initialized
        Locale.setDefault(Locale.KOREAN);
        validate(KOREAN, create());

        // it does not affect Swing because it is initialized
        Locale.setDefault(Locale.CANADA);
        validate(KOREAN, create());

        // it definitely should affect Swing
        JComponent.setDefaultLocale(Locale.FRENCH);
        validate(FRENCH, create());
    } finally {
        // restore the reserved locale
        Locale.setDefault(reservedLocale);
    }
}
 
Example 12
public static void main(String[] args) {
    Locale reservedLocale = Locale.getDefault();
    try {
        // it affects Swing because it is not initialized
        Locale.setDefault(Locale.KOREAN);
        validate(KOREAN, create());

        // it does not affect Swing because it is initialized
        Locale.setDefault(Locale.CANADA);
        validate(KOREAN, create());

        // it definitely should affect Swing
        JComponent.setDefaultLocale(Locale.FRENCH);
        validate(FRENCH, create());
    } finally {
        // restore the reserved locale
        Locale.setDefault(reservedLocale);
    }
}
 
Example 13
public static void main(String[] args) {
    Locale reservedLocale = Locale.getDefault();
    try {
        // it affects Swing because it is not initialized
        Locale.setDefault(Locale.KOREAN);
        validate(KOREAN, create());

        // it does not affect Swing because it is initialized
        Locale.setDefault(Locale.CANADA);
        validate(KOREAN, create());

        // it definitely should affect Swing
        JComponent.setDefaultLocale(Locale.FRENCH);
        validate(FRENCH, create());
    } finally {
        // restore the reserved locale
        Locale.setDefault(reservedLocale);
    }
}
 
Example 14
Source Project: collect-earth   File: Messages.java    License: MIT License 4 votes vote down vote up
public static void setLocale(Locale localeUI){
	Locale.setDefault( localeUI );
	JComponent.setDefaultLocale( localeUI );
	RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);		
}