Locales : I18N « Development Class « Java

Java
1. 2D Graphics GUI
2. 3D
3. Advanced Graphics
4. Ant
5. Apache Common
6. Chart
7. Collections Data Structure
8. Database SQL JDBC
9. Design Pattern
10. Development Class
11. Email
12. Event
13. File Input Output
14. Game
15. Hibernate
16. J2EE
17. J2ME
18. JDK 6
19. JSP
20. JSTL
21. Language Basics
22. Network Protocol
23. PDF RTF
24. Regular Expressions
25. Security
26. Servlets
27. Spring
28. Swing Components
29. Swing JFC
30. SWT JFace Eclipse
31. Threads
32. Tiny Application
33. Velocity
34. Web Services SOA
35. XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java » Development Class » I18NScreenshots 
Locales
 Locales

import java.text.DateFormatSymbols;
import java.util.Calendar;
import java.util.Locale;

public class DaysOfTheWeek {

  public static void main(String argv[]) {

    Locale usersLocale;

    if (argv.length == 2)
      usersLocale = new Locale(argv[0], argv[1]);
    else if (argv.length == 3)
      usersLocale = new Locale(argv[0], argv[1], argv[2]);
    else
      usersLocale = Locale.getDefault();

    DateFormatSymbols dfs = new DateFormatSymbols(usersLocale);
    String weekdays[] = dfs.getWeekdays();

    Calendar cal = Calendar.getInstance(usersLocale);

    int firstDayOfWeek = cal.getFirstDayOfWeek();
    int dayOfWeek;

    for (dayOfWeek = firstDayOfWeek; dayOfWeek < weekdays.length; dayOfWeek++)
      System.out.println(weekdays[dayOfWeek]);

    for (dayOfWeek = 0; dayOfWeek < firstDayOfWeek; dayOfWeek++)
      System.out.println(weekdays[dayOfWeek]);
  }
}

           
       
Related examples in the same category
1. I18N SortI18N Sort
2. Java I18N: Format : Choice Format DemoJava I18N: Format : Choice Format Demo
3. Java I18N: Format : Date FormatJava I18N: Format : Date Format
4. Java I18N: Format : Date Format Symbols DemoJava I18N: Format : Date Format Symbols Demo
5. Java I18N: Format : Message Format DemoJava I18N: Format : Message Format Demo
6. Java I18N: Format : Number FormatJava I18N: Format : Number Format
7. Java I18N: Format : Simple Date FormatJava I18N: Format : Simple Date Format
8. Java I18N: IntroductionJava I18N: Introduction
9. List all LocaleList all Locale
10. Displays Charsets and aliasesDisplays Charsets and aliases
11. Encode and DecodeEncode and Decode
12. List Locale OrientationList Locale Orientation
13. Resource Bundle in Java code
14. List Resource Bundle Creator
15. Simple Resource Bundle
16. Your own Resource Bundle
17. Displaying Formatted Numbers for Alternate LocalesDisplaying Formatted Numbers for Alternate Locales
18. Convert Encoding
19. Menu created from property file
20. Unicode DisplayUnicode Display
21. Demonstrate number and date internationalizationDemonstrate number and date internationalization
22. Set of convenience routines for internationalized code
23. Print the default locale
24. Use some locales choicesUse some locales choices
25. Format some values using the default locale
26. List LocalesList Locales
27. Create one button, internationalizedly
28. Show DateShow Date
29. Change the default locale
30. java.util.Locale and java.text.NumberFormatjava.util.Locale and java.text.NumberFormat
31. Collation Test Collation Test
32. Number Format Test Number Format Test
33. Java Internationalization: load string from properties Java Internationalization: load string from properties
34. Locale 2Locale 2
35. Display Language OutputDisplay Language Output
36. Display Name OutputDisplay Name Output
37. Display Variant OutputDisplay Variant Output
38. Constant Locale UsageConstant Locale Usage
39. Country Language CodesCountry Language Codes
40. Isolating Locale-Specific Data with Resource Bundles Isolating Locale-Specific Data with Resource Bundles
41. Property To List Resource Bundle
42. Which Bundle Comes First
43. Calendar Manipulation for I18N (Internationalization)Calendar Manipulation for I18N (Internationalization)
44. Formatting Messages: Arabic DigitFormatting Messages: Arabic Digit
45. Formatting Messages: Change EraFormatting Messages: Change Era
46. Formatting Messages: Message Format ReuseFormatting Messages: Message Format Reuse
47. Character Sets and Unicode: Code Set Conversion
48. Searching, Sorting, and Text Boundary Detection: Collation IssuesSearching, Sorting, and Text Boundary Detection: Collation Issues
49. Searching, Sorting, and Text Boundary Detection: Detecting Text BoundariesSearching, Sorting, and Text Boundary Detection: Detecting Text Boundaries
50. Spanish SortSpanish Sort
51. Sort With Collation KeysSort With Collation Keys
52. DecompositionDecomposition
53. Formatting Messages: Date and NumberFormatting Messages: Date and Number
54. Internationalized Graphical User Interfaces: Component OrientationInternationalized Graphical User Interfaces: Component Orientation
55. Internationalized Graphical User Interfaces: Component Orientation 1Internationalized Graphical User Interfaces: Component Orientation 1
56. Localized JOptionPane
57. Big Demo for I18N
58. Component Orientation Bundle
59. Java Input Method Framework
60. Popup in FrenchPopup in French
61. I18N : TextI18N : Text
ww_w.j___a__v__a___2__s___.__c_o__m_ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.