*
The moose likes Swing / AWT / SWT and the fly likes How to make a dialog to keep in English Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to make a dialog to keep in English" Watch "How to make a dialog to keep in English" New topic
Author

How to make a dialog to keep in English

Jevon Wang
Greenhorn

Joined: Apr 20, 2002
Posts: 6
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.


;;;;;.<br />O-O--; Hello, I am Jevon.<br />.L<br />.--
Rene Liebmann
Ranch Hand

Joined: May 02, 2002
Posts: 196
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

Joined: Apr 20, 2002
Posts: 6
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

Joined: May 02, 2002
Posts: 196
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.
 
 
subject: How to make a dialog to keep in English