Thread View: borland.public.jbuilder.java.api
2 messages
2 total messages
Started by George
Thu, 17 Jun 2004 19:20
ListResourceBundle problem
Author: George
Date: Thu, 17 Jun 2004 19:20
Date: Thu, 17 Jun 2004 19:20
45 lines
1893 bytes
1893 bytes
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"
Re: ListResourceBundle problem
Author: George
Date: Fri, 18 Jun 2004 13:24
Date: Fri, 18 Jun 2004 13:24
52 lines
2232 bytes
2232 bytes
OK, never mind, forgot to include package name in specifying the class.
"George" <geo_54321@yahoo.com> wrote in message
news:40d1ee87$1@newsgroups.borland.com...
> 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"
>
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads