FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Architecture & Design
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
January 01, 2002

Java@Work | Parlez-Vous Java? (Web Techniques, Sep 2000)

(Page 3 of 7)
import java.applet.*;
import java.awt.*;
import java.util.*;

public class Intl extends Applet { Label theLbl = new Label(); Font font = new Font("Serif",Font.BOLD,24);

// test function private static void dbg(Locale l) { Locale.setDefault(l); System.out.println(Locale.getDefault().toString() + "=" + l.getDisplayLanguage() + "/" + l.getDisplayCountry()); ResourceBundle rez = ResourceBundle.getBundle("IntlRes"); System.out.println(rez.getString("msg1")); System.out.println(rez.getString("msg2")); }

// test main -- calls test function for a few countries public static void main(String[] args) { dbg(Locale.FRANCE); dbg(Locale.US); dbg(Locale.UK); dbg(Locale.CANADA); // nothing specific -- gets default }

public void init() { ResourceBundle rez = ResourceBundle.getBundle("IntlRes"); theLbl.setFont(font); theLbl.setText(rez.getString("msg1")); add(theLbl); } }

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK