|
-
Oct 14th, 2008, 05:16 AM
#1
Thread Starter
New Member
Set language pack
Hello,
I'm trying to implement an langauge system in my java app.
I have in the language pack 3 .java files:
- English
- Spanish
- Language
The language.java file makes the variables public static and the english or spanish.java file defines the variables. Only I can't get this working.
Code:
package com.blades.decoy.settings.language;
public interface Language {
String msg_welcome = "";
String msg_connect_info = "";
String msg_ip_info = "";
String msg_port_info = "";
String btn_connect = "";
public static String msg_login_info = "";
public static String msg_login_fault_password = "";
public static String msg_login_fault_username = "";
public static String msg_login_correct = "";
public static String btn_login = "";
}
In the english.java and spanish.java netbeans says: "Local variable hides a field." How would you make the english.java file?
Many thanks,
Night Fox
-
Oct 14th, 2008, 05:25 AM
#2
Re: Set language pack
I don't know what you are trying to say but this is not the way we do localization in java..
http://bits.netbeans.org/dev/javadoc...-branding.html
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Oct 14th, 2008, 05:33 AM
#3
Thread Starter
New Member
Re: Set language pack
 Originally Posted by ComputerJy
That's not what I was looking for. I just want to define the variables in another .java file. Is that simple enough =).
Thx.
-
Oct 14th, 2008, 06:19 AM
#4
Re: Set language pack
Well, the warning "Local variable hides a field" means that a variable in some method has the same name as a class member.. It's just a warning not an error, meaning that in that method you need to use this.fieldName to access the class member instead of just using fieldName.
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|