如何使用LWUIT主题
问题描述:
我想用LWUIT
以良好的方式制作我的应用程序的GUI。但是我面临的问题是我无法使用主题。如何使用LWUIT主题
我之前跟着这个链接The Lightweight User Interface Toolkit LWUIT An Introduction。
我已经使用此代码来加载主题。但它给了我例外。
try {
Resources r = Resources.open("theme.res");
UIManager.getInstance().setThemeProps(r.getTheme("theme"));
} catch (IOException ioe) {
System.out.println("Couldn't load theme.");
}
请帮我解决这个问题。这是非常紧急的。
谢谢
答
从代码现在看来,这可能会引发FileNotFoundException
仔细检查您的theme.res
文件应该是默认的包。如果它在一些包中,那么
Resources r = Resources.open("/com/mycompany/somepackage/theme.res");
可以请你发布异常stacktrace? – 2011-02-02 11:34:55