BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ListResourceBundle problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder JavaAPI
View previous topic :: View next topic  
Author Message
George
Guest





PostPosted: Thu Jun 17, 2004 7:20 pm    Post subject: ListResourceBundle problem Reply with quote



Just started out with internalization. I am getting a
MissingResourceException with the following code. Any help will be
appreciated.

package filemanager;
import java.util.*;
public class TestI18N {
public TestI18N() {
}

public static void main(String [] args) {
ResourceBundle rb = ResourceBundle.getBundle("TestResources",
Locale.getDefault());
}

private class TestResources extends ListResourceBundle {
protected Object[][] getContents() {
return contents;
}

private final Object[][] contents = {
{"PROPERTY_1", "PROPERTY_1"},
{"PROPERTY_2", "PROPERTY_2"},
};

}
}


This is the stack trace

java.util.MissingResourceException: Can't find bundle for base name
TestResources, locale en_US

at
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:8
04)

at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:773)

at java.util.ResourceBundle.getBundle(ResourceBundle.java:538)

at filemanager.TestI18N.main(TestI18N.java:19)

Exception in thread "main"


Back to top
George
Guest





PostPosted: Fri Jun 18, 2004 1:24 pm    Post subject: Re: ListResourceBundle problem Reply with quote



OK, never mind, forgot to include package name in specifying the class.

"George" <geo_54321 (AT) yahoo (DOT) com> wrote

Quote:
Just started out with internalization. I am getting a
MissingResourceException with the following code. Any help will be
appreciated.

package filemanager;
import java.util.*;
public class TestI18N {
public TestI18N() {
}

public static void main(String [] args) {
ResourceBundle rb = ResourceBundle.getBundle("TestResources",
Locale.getDefault());
}

private class TestResources extends ListResourceBundle {
protected Object[][] getContents() {
return contents;
}

private final Object[][] contents = {
{"PROPERTY_1", "PROPERTY_1"},
{"PROPERTY_2", "PROPERTY_2"},
};

}
}


This is the stack trace

java.util.MissingResourceException: Can't find bundle for base name
TestResources, locale en_US

at

java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:8
04)

at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:773)

at java.util.ResourceBundle.getBundle(ResourceBundle.java:538)

at filemanager.TestI18N.main(TestI18N.java:19)

Exception in thread "main"





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder JavaAPI All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.