Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

JColorchooser - Locale

Thread view: 
widebull - 19 Sep 2006 15:58 GMT
On application startup I set a different locale from JVM.

JColorChooser show strings in JVM default locale.

How can set the right language in JColorChooser whitout change dhe
default JVM language?

thanks

Signature

Posted via a free Usenet account from http://www.teranews.com

Thomas Hawtin - 19 Sep 2006 16:13 GMT
> On application startup I set a different locale from JVM.
>
> JColorChooser show strings in JVM default locale.
>
> How can set the right language in JColorChooser whitout change dhe
> default JVM language?

Presumably calling setLocale on it should work. Or calling
JComponent.setDefaultLocale on application start up.

Tom hawtin
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/

widebull - 19 Sep 2006 16:30 GMT
Sembra che Thomas Hawtin abbia detto :
> JComponent.setDefaultLocale on application start up.

I have tryed but no result.

I have also tryed this

com.borland.dbswing.IntlSwingSupport support = new
com.borland.dbswing.IntlSwingSupport(Locale.ENGLISH);

whith no result.

Signature

Posted via a free Usenet account from http://www.teranews.com

Thomas Hawtin - 19 Sep 2006 16:51 GMT
> Sembra che Thomas Hawtin abbia detto :
>> JComponent.setDefaultLocale on application start up.
>
> I have tryed but no result.

A quick look at the source seems to indicate that the chooser locale
will only affect the preview title border.

From ColorChooserDialog API docs in JColorChooser.java:

    " * Note: This needs to be fixed to deal with localization!"

Looking further, in UIDefaults we have the line:

    private Locale defaultLocale = Locale.getDefault();

That's the wrong default. However, you should be able to change it with:

    UIManager.getDefaults().setDefaultLocale(locale);

Tom Hawtin
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/

Thomas Weidenfeller - 19 Sep 2006 16:51 GMT
> How can set the right language in JColorChooser whitout change dhe
> default JVM language?

If everything else fails, assign the following individual UIDefaults
keys new string values via the UIManager:

ColorChooser.cancelText
ColorChooser.hsbBlueText
ColorChooser.hsbBrightnessText
ColorChooser.hsbGreenText
ColorChooser.hsbHueText
ColorChooser.hsbNameText
ColorChooser.hsbRedText
ColorChooser.hsbSaturationText
ColorChooser.okText
ColorChooser.previewText
ColorChooser.resetText
ColorChooser.rgbBlueText
ColorChooser.rgbGreenText
ColorChooser.rgbRedText
ColorChooser.nameText
ColorChooser.swatchesNameText
ColorChooser.swatchesRecentText

And assign matching mnemonic values (integers) to

ColorChooser.rgbBlueMnemonic
ColorChooser.rgbGreenMnemonic
ColorChooser.rgbRedMnemonic

Note, this is a hack you should only consider if you can't get the
Locale handling to work.

/Thomas
Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.