30.5. JSpinner

 
[Page 889 ( continued )]

Chapter Summary

  • Java is the first language designed from the ground up to support internationalization. In consequence, it allows your programs to be customized for any number of countries or languages without requiring cumbersome changes in the code.


    [Page 890]
  • Java characters use Unicode in the program. The use of Unicode encoding makes it easy to write Java programs that can manipulate strings in any international language.

  • Java provides the Locale class to encapsulate information about a specific locale. A Locale object determines how locale-sensitive information, such as date, time, and number, is displayed, and how locale-sensitive operations, such as sorting strings, are performed. The classes for formatting date, time, and numbers , and for sorting strings are grouped in the java.text package.

  • Different locales have different conventions for displaying date and time. The java.text.DateFormat class and its subclasses can be used to format date and time in a locale-sensitive way for display to the user .

  • Different locales have different conventions for displaying date and time. To format a number for the default or a specified locale, use one of the static methods in the NumberFormat class to get a formatter. Use getInstance or getNumberInstance to get the normal number format. Use getCurrencyInstance to get the currency number format. And use getPercentInstance to get a format for displaying percentages.

  • Java uses the ResourceBundle class to separate locale-specific information, such as status messages and GUI component labels, from the program. The information is stored outside the source code and can be accessed and loaded dynamically at runtime from a ResourceBundle , rather than hard-coded into the program.

  • You can specify an encoding for a text file when constructing a PrintWriter or a Scanner .

 


Introduction to Java Programming-Comprehensive Version
Introduction to Java Programming-Comprehensive Version (6th Edition)
ISBN: B000ONFLUM
EAN: N/A
Year: 2004
Pages: 503

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net