Search code examples
netbeansjava-melwuit

The Resources class fails to load the theme into my app


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.


Solution

  • Put the Theme.res in the default package and preserve the same path