• Post Reply Bookmark Topic Watch Topic
  • New Topic

JOptionPane.showInputDialog() - can't change input language  RSS feed

 
Andrey Salamatin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings everyone!

I have an extremely simple program which contains following snippet:



When dialog shows up, the system language automatically changes to default (Russian in my case) — and I can't change it and type in another (English, for instance).


What can I do to resolve this disgusting problem? Thanks in advance!

 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Call Locale.setDefault(Locale.ENGLISH) (or any other) before showing the dialog. This will affect all locale dependent code though.
 
Andrey Salamatin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Rob, it doesn't work.

By the way, if I manually set language to English before showing the dialog, it's still EN in the taskbar — I just type all Russian.
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I am not quite sure where you are seeing Russian and English script, but have you tried the setProperty() method? You may need the method to get property names, to identify which property to set, and two get methods, to find its current value. You may also find your computer remains on English altogether until you set it back to Russian.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!