Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jan 2006

    How to access LWUIT theme (.res) file in my J2ME app? (I'm using Eclipse IDE)

    Hi all,

    I'm trying to get a REALLY simple HelloWorld app using LWUIT up and running, and I'm using the latest Eclipse IDE.

    Great news is it compiles and runs, bad news is it completely refuses to load and use any theme file (.res) I supply and I have no idea why - so I'm just getting an unthemed (black and white) LWUIT app.

    Error I am getting at runtime is:

    Installing suite from:

    ****Untrusted user classes must never be put
    ****on the system class path

    java.lang.NullPointerException: 0
    - java.io.DataInputStream.read(), bci=4
    - java.io.DataInputStream.readUnsignedShort(), bci=1
    - java.io.DataInputStream.readShort(), bci=1
    - com.sun.lwuit.util.Resources.openFile(), bci=20
    - com.sun.lwuit.util.Resources.<init>(), bci=28
    - com.sun.lwuit.util.Resources.open(), bci=16
    - HelloLWUITMIDlet.startApp(), bci=6
    - javax.microedition.midlet.MIDletTunnelImpl.callStartApp(), bci=1
    - com.sun.midp.midlet.MIDletPeer.startApp(), bci=7
    - com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=269
    - com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=52
    - com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=8
    - com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=161
    - com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26

    The important line being: - HelloLWUITMIDlet.startApp(), bci=6
    which when clicked hilights this line in my source:
    Resources r = Resources.open("themes2/test.res");

    That file (test.res) is showing correctly (I think?) in the Package Explorer heirarchy. To get it in there, I went to my project's properties in Eclipse, then Java Build Path->Source tab->Add folder, then added 'themes2' and right clicked 'themes2' in the hierarchy back in package explorer and hit 'refresh' so that it showed up the .res file in the hierarchy too.

    I've no idea why I'm getting the untrusted user classes warning at the top, and whether this is related to the theme not loading. When adding the LWUIT.jar in the first place, I again brought up my project's settings->Java Build Path->Libraries tab->Add External JARs... and then LWUIT.jar showed up in Package Explorer under my project, under 'Referenced Libraries' folder.

    I REALLY need some help PLEASE, am completely stuck!

    Relevant source code is:

    public void startApp() {

    try {
    Resources r = Resources.open("themes2/test.res");
    } catch (IOException ioe) {
    // Do something here.

    Form f = new Form("Hello, LWUIT!");



    Many thanks,

  2. #2
    Regular Contributor
    Join Date
    May 2007

    Re: How to access LWUIT theme (.res) file in my J2ME app? (I'm using Eclipse IDE)

    Avoid submitting duplicate threads. The same question has been asked in "Mobile Java General" also.

  3. #3
    Registered User
    Join Date
    Sep 2009
    Bangalore, India

    Post Re: How to access LWUIT theme (.res) file in my J2ME app? (I'm using Eclipse IDE)

    instead giving the theme name use..

    PHP Code:
    Resources r Resources.open("/resources/appTheme.res");

Similar Threads

  1. J2ME File Write Access in the jar file
    By bergteufel in forum Mobile Java General
    Replies: 2
    Last Post: 2010-03-20, 03:40
  2. Error with makesis.exe and creating the .pkg file
    By gramya87 in forum Symbian Tools & SDKs
    Replies: 7
    Last Post: 2007-10-10, 13:53
  3. Replies: 0
    Last Post: 2005-02-16, 17:45
  4. how to access directories and files from J2ME app
    By johnmobile in forum Mobile Java General
    Replies: 6
    Last Post: 2004-01-23, 21:25
  5. access point for j2me app in nokia3650?
    By garyshi in forum Mobile Java General
    Replies: 0
    Last Post: 2003-06-11, 15:09

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts