...
>..in swing. So i thought if i can use the same icons
> as that in the swing option dialogs, user experience will be much
> consistant.
> My original problem is like this. In my application, the locale of the
> appliaction is decided by a language selection the user makes while
[quoted text clipped - 3 lines]
> and messages in English. Any suggestion on how this can be resolved
> will be much apreciated.
Dear Mr.Thompson,
For the messages which are displayed on the message box, i'm using
resource bundle and messages are being displayed in the correct
language. The problem i'm facing is with the text on button of the
message box. It seems that they are displayed based on the locale of
the Operating System. Or is there any way i can set the locale ofthe
whole application, so that button text will be shown in teh correct
language?
Thanks again
Chanchal
Andrew Thompson - 18 Mar 2008 06:06 GMT
> Dear Mr.Thompson,
Uggh.. (shudders) the only people that usually
call me 'Dear Mr. Thompson' are debt collection
agencies. The best way to refer to people around
usenet is 'not to', or to simply 'Quote' some
text they wrote and reply to it. (see above, it is
clear who said what, from teh bit that reads..
"On ... Chanchal .. wrote:").
> For the messages which are displayed on the message box,
Message box, now dialog box..
I asked you before..
"Would that be a JOptionPane you are referring to?"
I want to know what specific J2SE Java class
you are using to develop these 'boxes'.
(exasperated) ..And you have never bothered to
answer that *question*.
Please answer my question, so I can muster
the strength and fortitude to continue this
thread..
Or if anybody else feels they can help better
(looks around) don't be afraid to jump in.
The OP seems a nice chap, and I (probably)
won't bite you.
--
Andrew T.
PhySci.org
Chanchal - 18 Mar 2008 08:25 GMT
> "Would that be a JOptionPane you are referring to?"
>
> I want to know what specific J2SE Java class
> you are using to develop these 'boxes'.
What i plan to do is to extend JDialog and create a dialog box that
looks like the one diplayed by the JOptionPane.showMessageDialog()
method
Andrew Thompson - 18 Mar 2008 11:04 GMT
> > "Would that be a JOptionPane you are referring to?"
>
[quoted text clipped - 4 lines]
> looks like the one diplayed by the JOptionPane.showMessageDialog()
> method
Thanks for answering my question. :-)
I think Axel has identified the root answer
to this problem. Try setting the default
locale and using a JOptionPane.
--
Andrew T.
PhySci.org
Chanchal - 18 Mar 2008 13:25 GMT
> I think Axel has identified the root answer
> to this problem. Try setting the default
> locale and using a JOptionPane.
Actually that's exacltly what i have done. But still the button text
seems to go along with the locale of the OS. :-(
Chanchal
Andrew Thompson - 18 Mar 2008 15:53 GMT
> > I think Axel has identified the root answer
> > to this problem. Try setting the default
> > locale and using a JOptionPane.
>
> Actually that's exacltly what i have done. But still the button text
> seems ..
..seems? How about backing that up with *source*, ..
>...to go along with the locale of the OS. :-(
..like
<sscce>
import javax.swing.*;
import java.util.Locale;
class LocaleTest {
public static void main(String[] args) {
Locale.setDefault(Locale.GERMAN); // "Ja/Nein"
//Locale.setDefault(Locale.ITALIAN); // "Si/No"
//Locale.setDefault(Locale.FRENCH); // "Oui/Non"
JOptionPane jop = new JOptionPane(
"Message",
JOptionPane.INFORMATION_MESSAGE,
JOptionPane.YES_NO_OPTION
);
JDialog dialog = jop.createDialog(
null,
"Title");
dialog.setVisible(true);
}
}
</sscce>
What result are you getting for German there?
(Or either of the other two commented locales).
--
Andrew T.
PhySci.org
Sabine Dinis Blochberger - 19 Mar 2008 10:40 GMT
> Dear Mr.Thompson,
>
[quoted text clipped - 9 lines]
>
> Chanchal
If the JVM can't find the value specified in the corresponding resource
bundle, it will use the one in the default bundle.
For example
String locText = java.util.ResourceBundle.getBundle(
"eu/op3racional/op3MI/resources/displayStrings")
.getString("ds_label_nogroup");
if ds_label_nogroup is not in the resource bundle according to the
current locale, it will try to get it from the default bundle. It will
throw an exception if it doesn't exist anywhere, so you might want to
check your debug output.

Signature
Sabine Dinis Blochberger
Op3racional
www.op3racional.eu
Thomas A. Russ - 20 Mar 2008 19:29 GMT
> For the messages which are displayed on the message box, i'm using
> resource bundle and messages are being displayed in the correct
[quoted text clipped - 3 lines]
> whole application, so that button text will be shown in teh correct
> language?
What happens when you run the example code that was posted here?
Are you changing the locale before or after you create the dialog
object? Once it's created, it's probably too late to change the locale
and expect the already existing buttons to be updated.

Signature
Thomas A. Russ, USC/Information Sciences Institute