BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 05-09-2008, 03:36 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Dec 2007
Location: Spain
Model: 8100
Carrier: Vodafone
Posts: 26
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default ListField Background Color

Please Login to Remove!

Hi!!

I'm trying to set the background color in a ListField. I've developed a ListFieldCallback to paint the list. The method looks like this:


public void drawListRow( ListField list, Graphics g, int index, int y, int w) {
String text = (String)listElements.elementAt(index);
if( index % 2 == 1){
g.setColor(0x00555555);
g.setBackgroundColor(0x00ff0000);
}
Font defaultfont = Font.getDefault();
Font boldfont = defaultfont.derive(Font.BOLD,18);
g.setFont(boldfont);
g.drawText(text, 0, y, 0, w);
}

Font color changes correctly...but backgroundcolor not!!! any idea???

Regards
Offline  
Old 05-09-2008, 04:43 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Look at this:
How To - Create a colour ListField
Offline  
Old 05-09-2008, 04:46 AM   #3 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

edit: Ivanovs method seems to be better
__________________
java developer, Devinto, hamburg/germany

Last edited by simon.hain : 05-09-2008 at 04:48 AM.
Offline  
Old 05-13-2008, 05:31 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Dec 2007
Location: Spain
Model: 8100
Carrier: Vodafone
Posts: 26
Post Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Thank you very much! It is very easy to do!
Offline  
Closed Thread


Thread Tools

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

GE Solenoid CR9503-211EAB273 - New
$499.0
GE Solenoid CR9503-211EAB273 - New pictureSOLENOID AND MOTOR DRIVER IC CA3169 ( NEW ) X 5 PCS
$24.8
SOLENOID AND MOTOR DRIVER IC CA3169 ( NEW ) X 5 PCS pictureARO MQ3665-6 H0246 Solenoid Air Control Valve,1/4 In,12VDC 2.5 W
$85.0
ARO MQ3665-6 H0246  Solenoid Air Control Valve,1/4 In,12VDC 2.5 W pictureNEW FESTO MDH-5/2-D-2-FR-M12-C SOLENOID VALVE NEW OTHER OPEN BOX
$59.95
NEW FESTO MDH-5/2-D-2-FR-M12-C SOLENOID VALVE NEW OTHER OPEN BOX   picture145383 New-No Box, MAC 45A-L00-DFFJ Solenoid Valve, 24 VDC, 2.4 Watts
$22.97
145383 New-No Box, MAC 45A-L00-DFFJ Solenoid Valve, 24 VDC, 2.4 Watts picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.