Skip to content

Instantly share code, notes, and snippets.

@GreyTeardrop
Created March 14, 2012 22:29
Show Gist options
  • Select an option

  • Save GreyTeardrop/2040048 to your computer and use it in GitHub Desktop.

Select an option

Save GreyTeardrop/2040048 to your computer and use it in GitHub Desktop.
import java.util.Locale;
import java.util.prefs.Preferences;
public class Main {
public static void main(String[] args) {
Preferences preferences = Preferences.userNodeForPackage(Main.class);
String userLanguage = preferences.get("userLanguage", null);
if (userLanguage != null) {
Locale userLocale = new Locale(userLanguage);
Locale.setDefault(userLocale);
}
new MainFrame();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment