如何使用LWUIT主题
我想使用 LWUIT 来以良好的方式制作我的应用程序的 GUI。但我面临的问题是我无法使用主题。
我点击了此链接 轻量级用户界面工具包 LWUIT 简介。
我使用此代码来加载主题。但这给了我例外。
try {
Resources r = Resources.open("theme.res");
UIManager.getInstance().setThemeProps(r.getTheme("theme"));
} catch (IOException ioe) {
System.out.println("Couldn't load theme.");
}
I want to use LWUIT for making GUI of my application in good way. But the problem I am facing is I am not able to use a theme.
I had followed this link The Lightweight User Interface Toolkit LWUIT An Introduction.
I had used this code to load the theme. But it is giving me exception.
try {
Resources r = Resources.open("theme.res");
UIManager.getInstance().setThemeProps(r.getTheme("theme"));
} catch (IOException ioe) {
System.out.println("Couldn't load theme.");
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ResourceEdit 文件存储在哪里?我认为你在这里犯了错误。检查您的工作空间。
将 ResourceEdit 文件存储在“src”文件夹中。
在显示任何表单之前必须调用
Display.init(this)
方法。请参阅此链接以了解您的情况参考。Where you are stored ResourceEdit file? I think you made the mistake here. Check with your workspace.
Store the ResourceEdit file inside "src" folder.
Display.init(this)
method must be called before any Form is shown. See this link for your reference.从代码来看,它似乎可能会抛出
FileNotFoundException
仔细检查您的
theme.res
文件应该位于默认包中。如果它在某个包中那么from the code it seems it could throw
FileNotFoundException
Double check your
theme.res
file should be in default package. if its in some package then