BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 09-15-2008, 03:05 AM   #1 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 217
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default ObjectChoiceField

Please Login to Remove!

Hi everone,

I try to change the background color of an ObjectChoiceField.

Code:
list2 = new ObjectChoiceField("" , typeCuisine , 0)
{
    protected void paint( Graphics graphics ) 
    {
        graphics.clear();
        int color = graphics.getColor();
        graphics.setColor( 0x99caf3 );
        graphics.fillRect( 0, 0, Display.getWidth(), Display.getHeight() );
        graphics.setColor( color );

    }
};
So the result is that the background color change but the text isn't displayed.

The choice works because when I clic the list appears.

What's wrong??
Offline  
Old 09-15-2008, 06:34 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

you are not calling super.paint() so you are responsible for painting text as well.

I'm not sure if it works with objectchoicefield but for chageing the background I would try the "common" way

Code:
    protected void paint( Graphics graphics ) 
    {
        graphics.setBackgroundColor(Color.RED);
        graphics.clear();
        
        super.paint(graphics);
    }
Offline  
Old 09-15-2008, 08:19 AM   #3 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 217
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Allright I simply forget the super.paint().

Thanks a lot
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

Synertek 6502 CPU 40 PIN DIP SY6502 CPU for Commodore Apple Atari Acorn & Others
$7.99
Synertek 6502 CPU 40 PIN DIP SY6502 CPU for Commodore Apple Atari Acorn & Others pictureJelenko Commodore 100 Dental Laboratory Oven/Furnaces 120V - for Parts
$342.0
Jelenko Commodore 100 Dental Laboratory Oven/Furnaces 120V - for Parts pictureWINDSOR Commodore CMD Carpet Extractor Cleaning Machine 0541 Hours WORKING
$149.99
WINDSOR Commodore CMD Carpet Extractor Cleaning Machine 0541 Hours WORKING pictureVintage Commodore 310416-01 Power Supply AC Adapter
$59.99
Vintage Commodore 310416-01 Power Supply AC Adapter  pictureDDC IEEE-448 DATA BUS ADAPTER ILC DEVICE DBA-488 HPIB GPIB COMMODORE HP USED
$449.06
DDC IEEE-448 DATA BUS ADAPTER ILC DEVICE DBA-488 HPIB GPIB COMMODORE HP USED picture






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