如何在eclipse中使用资源文件。
飞行的兔子 2004-10-14 12:50:04 例如:
在运行jdk中的例子Notepad.java时,需要统一目录下的Resources目录下的Notepad.properties文件,例子中的代码如下:
private static ResourceBundle resources;
static {
try {
resources = ResourceBundle.getBundle("resources.Notepad", Locale.getDefault());
} catch (MissingResourceException mre) {
System.err.println("resources/Notepad.properties not found");
System.exit(1);
}
}
但是结果总是输出:resources/Notepad.properties not found
请问如何使程序能够正确地引用这个文件呢?不知大家看过这个例子没有?