资源类无法将主题加载到我的应用程序中
我创建了一个名为 Theme.res 的主题文件,并将其放置在与 .java 文件相同的文件中。 编译器似乎只是绕过了该代码段,模拟器显示与以前相同的黑白形式,没有任何应用的字体样式等。
public void startApp() {
Display.init(this);
try {
System.out.println ("print");
Resources r = Resources.open("/Theme.res");
System.out.println ("print");
UIManager.getInstance().setThemeProps(r.getTheme("myTheme"));
System.out.println ("print");
}
catch (java.io.IOException e) {
System.err.print ("lame");
}
Form f = new Form();
实际上只打印第一个“打印”。
提前致谢。
I created a theme file called Theme.res and placed it in the same file as the .java file.
The Compiler simply seems to bypass that segment of code and the emulator displays the same B&W form as before without any of the applied font styles etc.
public void startApp() {
Display.init(this);
try {
System.out.println ("print");
Resources r = Resources.open("/Theme.res");
System.out.println ("print");
UIManager.getInstance().setThemeProps(r.getTheme("myTheme"));
System.out.println ("print");
}
catch (java.io.IOException e) {
System.err.print ("lame");
}
Form f = new Form();
only the first "Print" is actually printed.
thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
Theme.res
放入默认包中并保留相同路径Put the
Theme.res
in the default package and preserve the same path