File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes change language English French label Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "change language English French label" Watch "change language English French label" New topic
Author

change language English French label

Nouf Nassri
Ranch Hand

Joined: Apr 22, 2010
Posts: 40
Hello everyone

I want to change the language of an application and for that I did a little test, I have a label and a button I'm worth when I click on the button the label name changed <name> <nom>



thank you
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535
    
    9

When the user clicked change, you loaded the bundle for English locale. After that.....?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 650
In your buttonActionPerformed() method, you set your resource variable to the resource bundle for English, but then don't do anything with it. I think you probably want to change the label on your JLabel control.

It this isn't clear why, just consider that the way the application is currently coded, you set the label on the JLabel control only when you create the application (in the initComponents() method).

Also, I see when you click the button you change from the default language to English. What is the default language? If it's English, you won't see any change anyway.

Finally, you should use import statements to import your javax.swing components, and not use the fully-qualified class name when referencing them in the code. The way you have it now makes it harder to read.
Nouf Nassri
Ranch Hand

Joined: Apr 22, 2010
Posts: 40
thanks , i use netbeans
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: change language English French label