0

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.");
}
halfer
  • 19,824
  • 17
  • 99
  • 186
shweta
  • 1,120
  • 1
  • 11
  • 25

2 Answers2

1

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.

bharath
  • 14,283
  • 16
  • 57
  • 95
  • I had stored my resource file in src folder and did the same as shown in the link.But then also it is showing same problem – shweta Feb 04 '11 at 04:49
  • Are u getting any exception? did u create the theme inside of resourceEdit? check with ur resourceEdit again. – bharath Feb 04 '11 at 05:25
1

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

Resources r = Resources.open("/com/mycompany/somepackage/theme.res");
jmj
  • 237,923
  • 42
  • 401
  • 438