strongcu
December 20th, 2002, 01:47 AM
I want to write a applet that display date and time in Germany.
If I write it by using class file and run with class file, it display correctly:
Date a = new Date(System.currentTimeMillis());
DateFormat oFmt=DateFormat.getDateInstance(DateFormat.LONG);
String sDate=oFmt.format(a);
System.out.println(sDate);
And it will diplay: "20. Dezember 2002", that's correct. But if I use an applet to display:
Date a = new Date(System.currentTimeMillis());
DateFormat oFmt=DateFormat.getDateInstance(DateFormat.LONG);
String sDate=oFmt.format(a);
g.drawString(sDate,5,30);
Then it will display: "December 20, 2002", it's English, not Germany.
I use Win2KAS English version, regional locale setting: Germany. Can you help me to display date in applet like "20. Dezember 2002". Thank you for reading.
If I write it by using class file and run with class file, it display correctly:
Date a = new Date(System.currentTimeMillis());
DateFormat oFmt=DateFormat.getDateInstance(DateFormat.LONG);
String sDate=oFmt.format(a);
System.out.println(sDate);
And it will diplay: "20. Dezember 2002", that's correct. But if I use an applet to display:
Date a = new Date(System.currentTimeMillis());
DateFormat oFmt=DateFormat.getDateInstance(DateFormat.LONG);
String sDate=oFmt.format(a);
g.drawString(sDate,5,30);
Then it will display: "December 20, 2002", it's English, not Germany.
I use Win2KAS English version, regional locale setting: Germany. Can you help me to display date in applet like "20. Dezember 2002". Thank you for reading.