You Are Here:

Community: Developer Discussion Boards

#1 Old MirrorProtocolParser.invokeMethod(Method, Object[]): Failure! Problem Pl Help me out - 2003-10-20, 13:52

Join Date: Oct 2003
Posts: 17
montooshah
Offline
Registered User
Hi Guys;
I am facing this stranger problem. I have a class GameCanvas extending FullCanvas. From this class i am making call to GamePlay class. After implicit call to contructor I am making call to onf of it's method and passing Graphics Object to it. This method in turn calls : public void drawgame(Graphics g). In this method I am drawing many Images, but at particular instance I am getting the problem

java.lang.NullPointerException
MirrorProtocolParser.invokeMethod(Method, Object[]): Failure!
--- Error while invoking reflected method : drawImage
--- Target exception was:java.lang.NullPointerException
at com.nokia.phone.sdk.concept.mirrors.lcdui.Graphics.drawImage([DashoPro-V1.32-013000])
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

I have checked it thropughly this variable is holding ImageFile , but still it is giving problem.

Code of method is given below:

public void drawgame(Graphics g)
{

g.drawImage(intfImg, 0, 0, 20);
boolean flag = false;
boolean flag1 = false;
int k = 0;
for(int l = 1; l < gridW - 1; l++)
{

for(int i1 = 1; i1 < gridH - 1; i1++)
{

if(boardArr[l][i1] > 0)
k = boardArr[l][i1] - 1;
int i = Xcord + (l - 1) * blockWidth;
int j = Ycord + (i1 - 1) * blockWidth;
g.setColor(255, 255, 255);
g.fillRect(i, j, blockWidth, blockWidth);
g.setColor(0x635dad);
g.drawRect(i, j, blockWidth, blockWidth);
if(boardArr[l][i1] > 0 && boardArr[l][i1] != 99)
{

try
{
g.drawImage(shellImg[k], i -20 , j -20 , 20); // Here is the Problem..............................//
}
catch(Exception e)
{
System.out.println("Error: " + e);
}

g.setColor(0x635dad);
g.drawRect(i, j, blockWidth, blockWidth);

}
if(l == selX && i1 == selY)
{
g.setColor(0, 0, 255);
g.drawRect(i + 1, j + 1, blockWidth - 2, blockWidth - 2);
g.drawRect(i, j, blockWidth, blockWidth);
}
if(l == chosenX[0] && i1 == chosenY[0])
{
g.setColor(255, 0, 0);
g.drawRect(i + 2, j + 2, blockWidth - 4, blockWidth - 4);
}
if(l == chosenX[1] && i1 == chosenY[1])
{
g.setColor(255, 0, 0);
g.drawRect(i + 2, j + 2, blockWidth - 4, blockWidth - 4);
}
if(boardArr[l][i1] == 0 || boardArr[l][i1] == 99)
g.drawImage(dropImage, i + 1, j + 1, 20);

}

}


}

If I commant the line which is giving me problem it draw all Images. But it is not giving me right output. This line is imortant and

problemetic. Pl help me out. It is very urgent.
-Hemal montooshah@rediffmail.com, monts120@yahoo.com.
Reply With Quote

#2 Old 2003-10-20, 16:17

Join Date: Jun 2003
Posts: 4,325
Location: Cheshire, UK
grahamhughes's Avatar
grahamhughes
Offline
Forum Nokia Champion
On what are you having this problem?

I get the same problem when using the Series 40 Concept SDK emulator, though the same code will work on the 7210 emulator and my real 6100.

So I don't use the Concept SDK emulator any more!

Graham.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d134434X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ