Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to make a dialog to keep in English

 
Jevon Wang
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
When I use a static method to show a dialog during my application running, however the dialog will contain at least button that have a label in it.
The problem is that the button's label is in your local languge automatically ,for example, in Japanese or Chinese.
Is there any way to make a dialog to keep in English???
Thank you.
 
Rene Liebmann
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I assume you use JOptionPane? This class has a static method

In the Object[] you can specify for example:
String[] strArray = {"Ja", "Nein"};
Then you would have instead of "Yes" and "No" the strings given in the array.
Hope that helps
Rene
 
Jevon Wang
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you a lot.
I have tried to show a dialog depending what you said.
But it seems this way is not a general solution for model dialogs.
So, What about the class JFileChooser?
Anyway I will try it again, Thank you ,Thank you.
 
Rene Liebmann
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you are right JFileChooser might be really a problem. There you can only set the text for the Approve button, but not for the other ones.
But for the JOptionPane, it was the right way I suggested.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic