×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Location
    Luton, Bedfordshire, UK
    Posts
    29

    createImage on Nokia Series 40 MIDP Concept SDK Beta 0.3

    I haven't installed NDS 2 yet so I'm still using 1.1, and this is the S40 emulator that came with it.

    I'm creating a spacer graphic in a longish 'Settings' form, to separate out various sections. I create a mutable image, draw into it, then create an immutable one from it to actually add to the form.

    This is the code (ignore the extra braces, that's just my hangup about name pollution):

    // Create a nice spacer image.
    Image spacer;
    int layout = ImageItem.LAYOUT_NEWLINE_BEFORE | ImageItem.LAYOUT_CENTER | ImageItem.LAYOUT_NEWLINE_AFTER;
    {
    Image temp = Image.createImage( 50, 11 ); // 4 white pixels above and below.
    Graphics g = temp.getGraphics();
    g.setColor( 0 );
    g.fillRect( 0, 5, 50, 3 ); // 5th to 7th vertically.
    g.setColor( 255, 0, 0 );
    g.drawLine( 1, 6, 49, 6 ); // 6th vertically.
    // Now make it immutable so it can be used.
    spacer = Image.createImage( temp );
    }

    It works on all the other emulators, but on this one I get the following error:

    Nokia Series 40 MIDP Concept SDK Beta 0.3: MirrorProtocolParser.invokeMethod(Method, Object[]): Failure!

    Nokia Series 40 MIDP Concept SDK Beta 0.3: java.lang.NullPointerException

    Nokia Series 40 MIDP Concept SDK Beta 0.3: --- Error while invoking reflected method : createImmutableImage

    Nokia Series 40 MIDP Concept SDK Beta 0.3: at s40a2.b([DashoPro-V1.32-013000])

    Nokia Series 40 MIDP Concept SDK Beta 0.3: at s40a2.<init>([DashoPro-V1.32-013000])

    Nokia Series 40 MIDP Concept SDK Beta 0.3: --- Target exception was:java.lang.NullPointerException

    Nokia Series 40 MIDP Concept SDK Beta 0.3: at com.nokia.phone.sdk.concept.mirrors.lcdui.ImageCache.createImmutableImage([DashoPro-V1.32-013000])

    Nokia Series 40 MIDP Concept SDK Beta 0.3: at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)

    Nokia Series 40 MIDP Concept SDK Beta 0.3: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    Nokia Series 40 MIDP Concept SDK Beta 0.3: at java.lang.reflect.Method.invoke(Method.java:324)

    Nokia Series 40 MIDP Concept SDK Beta 0.3: at s40p.a([DashoPro-V1.32-013000])

    Nokia Series 40 MIDP Concept SDK Beta 0.3: at s40p.a([DashoPro-V1.32-013000])

    Nokia Series 40 MIDP Concept SDK Beta 0.3: at s40o.run([DashoPro-V1.32-013000])

    Nokia Series 40 MIDP Concept SDK Beta 0.3: at java.lang.Thread.run(Thread.java:536)


    I don't have an actual S40 to test it on. Has anybody had a similar experience?


    Cheers,
    Gerard.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    Yep - I get the same in the S40 "Concept". Not a very good concept, is it? Good news is: I don't get the same error on the 7210 emulator, or on my 6100 phone.

    If you're developing for the Series 40, use the 7210 emulator - not the concept beta - it's much more like the real thing.

    Graham

  3. #3
    Registered User
    Join Date
    Mar 2003
    Location
    Luton, Bedfordshire, UK
    Posts
    29
    Thanks!

Posting Permissions

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