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.

Reply With Quote

