title: Get current language that is used in another application using java
body: <p>I'm learning <code>java.awt.Robot</code> and want to select my browser window, click in address bar and enter address.
  So to enter said address I need to make sure that current language used in browser is English.</p>
  
  <p>I tried this:</p>
  
  <pre><code>String s = InputContext.getInstance().getLocale().getLanguage();
  System.out.println(s);
  decker.changeLanguage();
  s = InputContext.getInstance().getLocale().getLanguage();
  System.out.println(s);
  </code></pre>
  
  <p>But both times I get:</p>
  
  <pre><code>en
  en
  </code></pre>
  
  <p>Although I can see in real time the language is changing. Can I get the language that is currently used in window that I'm currently controlling with my application.</p>