View Single Post
  (#1 (permalink)) Old
sgallego Offline
Knows Where the Search Button Is
 
Posts: 15
Join Date: Dec 2007
Location: Spain
Model: 8100
Carrier: Vodafone
Default ListField Background Color - 05-09-2008, 03:36 AM

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
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!