You Are Here:

Community: Developer Discussion Boards

#1 Old CustomItem - generates IllegalAccessError - 2007-03-30, 01:55

Join Date: Aug 2003
Posts: 28
fsukhu
Offline
Registered User
Hi,

I am trying to use the CustomItem and my starting point is the code from the example that I got from here: http://developers.sun.com/techtopics...ems/index.html

This code does not seem to work for me. It throws an IllegalAccessError when line 6 is executed.


Code:
1:       public void paint( Graphics g, int w, int h )
2:       {
3:		// clear all with background color
4:		int colour = 0;
5:		colour = DISPLAY.getColor(DISPLAY.COLOR_BACKGROUND );
6:		g.setColor(colour);
7:		g.fillRect( 0, 0, w, h );			
8:		// now use foreground color for drawing
9:		colour = DISPLAY.getColor(DISPLAY.COLOR_FOREGROUND);
10:		g.setColor(colour);			            
        }
Here is what is displayed in the console:

Code:
Ca the: alg.Error: IlAcessro
ava.laError: IllegalAccessErrorCallback thre: jav.lang.Error: legaAceError
Callback threI
For some reason that I don't understand, the console output is messed up but you can make out that it is complaining about an IllegalAccessError in some callback method.

At first I thought that it may be a bug in the S60 3rd Edtion SDK that I was using so I downloaded the latest to eliminate that possibility - that made no difference.

I have read the doc on DISPLAY and the code looks correct to me. Do you see anything that I am doing wrong?

Thanks for any help that you can provide,
Frank
Reply With Quote

#2 Old Re: CustomItem - generates IllegalAccessError - 2007-03-30, 14:27

Join Date: Aug 2006
Posts: 486
Location: Rawalpindi, Pakistan
Send a message via MSN to nicenouman
nicenouman
Offline
Regular Contributor
i might be wrong but i think its worth a shot.
in your code when u setcolor the first time. then wait for a second or two. there is a possibility that the first setcolor is still not complete and ur calling another setcolor which gives an illegel access. it might not work but what do we got to lose.


Regards
Nouman
Reply With Quote

#3 Old Re: CustomItem - generates IllegalAccessError - 2007-03-30, 15:38

Join Date: Aug 2003
Posts: 28
fsukhu
Offline
Registered User
Thanks nicenouman. Good idea.

I tried waiting for 5 seconds but the results are the same.
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
Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with TextField and CustomItem on the same Form manmli Mobile Java General 8 2008-12-23 14:10
CustomItem traversal on MIDP Form - bug? mbetan Mobile Java General 8 2008-12-02 18:43
Video player on CustomItem dyuen000 Mobile Java Media (Graphics & Sounds) 3 2007-07-02 19:32
CustomItem traverse problem on S60 lady_biju Mobile Java General 2 2006-11-17 13:43
Force CustomItem to get focus and display completely sirsio Mobile Java General 0 2006-03-20 08:50

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