/** * SystemLocaleInfo returns all data available from the Locale class. * * Copyright &copy; 1996-1998 Martin Minow. All Rights Reserved.<p> * * Permission to use, copy, modify, and redistribute this software and its * documentation for personal, non-commercial use is hereby granted provided that * this copyright notice and appropriate documentation appears in all copies. This * software may not be distributed for fee or as part of commercial, "shareware," * and/or not-for-profit endevors including, but not limited to, CD-ROM collections, * online databases, and subscription services without specific license.<p> * * @author <a href="mailto:minow@apple.com">Martin Minow</a> * @version 1.0 * Set tabs every 4 characters. */import java.util.*;import java.awt.*;public class SystemLocaleInfo extends SystemInfo{	Date			now				= new Date();		public SystemLocaleInfo(			EtchedBorder		border		)	{		super(border);		append("Current time\n");		append("               GMT: " + now.toGMTString() + "\n");		append("             Local: " + now.toLocaleString() + "\n");		append("          toString: " + now.toString() + "\n");		try {			Locale	thisLocale	= Locale.getDefault();			append("Default Locale:     " + thisLocale.toString() + "\n");			append("getCountry:         " + thisLocale.getCountry() + "\n");			append("getDisplayCountry:  " + thisLocale.getDisplayCountry() + "\n");			append("getDisplayLanguage: " + thisLocale.getDisplayLanguage() + "\n");			append("getDisplayName:     " + thisLocale.getDisplayName() + "\n");			append("getDisplayVariant:  " + thisLocale.getDisplayVariant() + "\n");			try {				append("getISO3Country:     " + thisLocale.getISO3Country() + "\n");			}			catch (MissingResourceException e) {				append("getISO3Country: " + e + "\n");			}			try {				append("getISO3Language:    " + thisLocale.getISO3Language() + "\n");			}			catch (MissingResourceException e) {				append("getISO3Language: " + e + "\n");			}			append("getLanguage:        " + thisLocale.getLanguage() + "\n");			append("getVariant:         " + thisLocale.getVariant() + "\n");			/* */			append("Current date\n");			int		year		= now.getYear();			int		month		= now.getMonth();			int		date		= now.getDate();			int		dayOfWeek	= now.getDay();			append(" Year:              " + year + "\n");			append(" Month:             " + month + "\n");			append(" Date:              " + date + "\n");			append(" DayOfWeek:         " + dayOfWeek + "\n");			append(" Timezone offset:   " + now.getTimezoneOffset() + "\n");			SimpleTimeZone tz = (SimpleTimeZone) TimeZone.getDefault();			append("Default TimeZone:   " + "\n");			append(" getID:             " + tz.getID() + "\n");			append(" getRawOffset:      " + tz.getRawOffset() + "\n");			append(" getOffset("				+ Integer.toString(1900 + year)				+ "," + month				+ "," + date				+ "," + dayOfWeek				+ ",0): "				+ tz.getOffset(GregorianCalendar.AD, year + 1900, month, date, dayOfWeek, 0)			 + "\n");			append(" inDaylightTime:    " + tz.inDaylightTime(now) + "\n");			/* */			append("Current date in GMT timezone\n");			tz = (SimpleTimeZone) TimeZone.getTimeZone("GMT");			append(" getID:             " + tz.getID() + "\n");			append(" getRawOffset:      " + tz.getRawOffset() + "\n");			append(" getOffset:         " + tz.getOffset(					GregorianCalendar.AD, year + 1900, month, date, dayOfWeek, 0) + "\n");			append(" inDaylightTime:    " + tz.inDaylightTime(new Date()) + "\n");			/* */					}		catch (Exception e) {			append("Strange error: " + e + "\n");			e.printStackTrace();		}	}}