List of usage examples for java.util Locale getDefault
public static Locale getDefault()
From source file:Main.java
public static void main(String[] argv) throws Exception { Locale myLocale;//from ww w .j ava2s.c om if (argv.length < 2) myLocale = Locale.getDefault(); else myLocale = new Locale(argv[0], argv[1]); ComponentOrientation ce = ComponentOrientation.getOrientation(myLocale); System.out.println("Is horizontal? " + ce.isHorizontal()); System.out.println("Is left to right? " + ce.isLeftToRight()); }
From source file:Main.java
public static void main(String[] args) { GregorianCalendar cal = new GregorianCalendar(TimeZone.getDefault(), Locale.getDefault()); System.out.println(cal.getTime()); }
From source file:Main.java
public static void main(String[] argv) throws Exception { DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.LONG, Locale.getDefault()); String s = dateFormat.format(new Date()); System.out.println(s);/*from w w w .ja va 2 s .c o m*/ }
From source file:Main.java
public static void main(String[] args) { NumberFormat formatter = new DecimalFormat(); Locale locale = Locale.getDefault(); System.out.println("Locale = " + locale); System.out.println(formatter.format(123.123)); locale = Locale.ITALY;/*from w ww . ja v a 2 s .com*/ Locale.setDefault(locale); formatter = new DecimalFormat(); System.out.println("Locale = " + locale); System.out.println(formatter.format(123.123)); }
From source file:Main.java
public static void main(String[] args) { String text = "this is a test(this is a test)."; BreakIterator wordIterator = BreakIterator.getWordInstance(Locale.getDefault()); extractWords(text, wordIterator);//ww w .j a v a 2 s .c o m }
From source file:Main.java
public static void main(String args[]) { Calendar now = Calendar.getInstance(); Locale locale = Locale.getDefault(); Map<String, Integer> names = now.getDisplayNames(Calendar.DAY_OF_WEEK, Calendar.LONG, locale); SortedMap<String, Integer> nav = new TreeMap<String, Integer>(names); System.out.printf("Whole list:%n%s%n", nav); System.out.printf("First key: %s\tFirst entry: %s%n", nav.firstKey(), nav.firstEntry()); }
From source file:Main.java
public static void main(String args[]) { Calendar now = Calendar.getInstance(); Locale locale = Locale.getDefault(); Map<String, Integer> names = now.getDisplayNames(Calendar.DAY_OF_WEEK, Calendar.LONG, locale); NavigableMap<String, Integer> nav = new TreeMap<String, Integer>(names); System.out.printf("Whole list:%n%s%n", nav); System.out.printf("Key higher after Sunday: %s%n", nav.higherKey("Sunday")); }
From source file:Main.java
public static void main(String args[]) { Calendar now = Calendar.getInstance(); Locale locale = Locale.getDefault(); Map<String, Integer> names = now.getDisplayNames(Calendar.DAY_OF_WEEK, Calendar.LONG, locale); NavigableMap<String, Integer> nav = new TreeMap<String, Integer>(names); System.out.printf("Whole list:%n%s%n", nav); System.out.printf("Map before Sunday: %s%n", nav.navigableKeySet()); }
From source file:Main.java
public static void main(String args[]) { Calendar now = Calendar.getInstance(); Locale locale = Locale.getDefault(); Map<String, Integer> names = now.getDisplayNames(Calendar.DAY_OF_WEEK, Calendar.LONG, locale); NavigableMap<String, Integer> nav = new TreeMap<String, Integer>(names); System.out.printf("Whole list:%n%s%n", nav); System.out.printf("Last key: %s\tLast entry: %s%n", nav.lastKey(), nav.lastEntry()); }
From source file:Main.java
public static void main(String args[]) { Calendar now = Calendar.getInstance(); Locale locale = Locale.getDefault(); Map<String, Integer> names = now.getDisplayNames(Calendar.DAY_OF_WEEK, Calendar.LONG, locale); NavigableMap<String, Integer> nav = new TreeMap<String, Integer>(names); System.out.printf("Whole list:%n%s%n", nav); System.out.printf("Key floor before Sunday: %s%n", nav.floorKey("Sunday")); }