Re: non-static method cannot be referenced from a static context

Discussion in 'Java' started by Johannes Beekhuizen, Aug 5, 2005.

  1. Hallo dave,

    Op 05 Aug 05 schreef aan All:

    d> // String envLang = System.getenv("LANG"); // Wordt niet meer
    d> ondersteund.

    What should I use instead then? The idea is that the user gets the default
    language from his login environment [Linux]. Usually this will be Dutch, but I
    know at least one who prefers Spanish.

    Groetjes,

    Hans.
     
    Johannes Beekhuizen, Aug 5, 2005
    #1
    1. Advertising

  2. Johannes Beekhuizen wrote:

    >
    > d> // String envLang = System.getenv("LANG"); // Wordt niet meer
    > d> ondersteund.
    >
    > What should I use instead then? The idea is that the user gets the default
    > language from his login environment [Linux]. Usually this will be Dutch, but I
    > know at least one who prefers Spanish.

    You can use
    String envLang = Locale.getDefault().getLanguage();
    instead. More info is in the javadoc of class java.util.Locale .

    --
    "Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')
     
    Thomas Fritsch, Aug 5, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gary
    Replies:
    1
    Views:
    4,066
    Ryan Stewart
    Jan 16, 2004
  2. Michael
    Replies:
    3
    Views:
    4,973
    Adam Jenkins
    Jan 27, 2004
  3. G. Burton
    Replies:
    2
    Views:
    59,947
    Sudsy
    Feb 21, 2004
  4. Johannes Beekhuizen
    Replies:
    14
    Views:
    1,362
    John B. Matthews
    Aug 5, 2005
  5. Johannes Beekhuizen
    Replies:
    0
    Views:
    1,551
    Johannes Beekhuizen
    Aug 5, 2005
Loading...

Share This Page