BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-03-2010, 05:26 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2009
Model: 8300
PIN: N/A
Carrier: Rogers
Posts: 43
Post Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Custom RichTextField NON_FOCUSABLE.. How is it done?

Please Login to Remove!

hey all,

I found this class below online. it works great for what i need, but I want to make the text unselectable. I know normally you add "Field.NON_FOCUSABLE" as one of the parameters to a richtextfield to make that work... but not sure what to do if it's a custom one like below.

Thanks in advance!!

Code:
class SectionHeader extends RichTextField { 
 
        int mTextColor; 
        int mBgColor; 
 
        public SectionHeader(String text, int bgColor, int textColor) { 
                super(text); 
                mTextColor = textColor; 
                mBgColor = bgColor; 
        } 
 
        protected void paint(Graphics graphics) { 
                graphics.clear(); 
                graphics.setColor(mBgColor); 
                graphics.fillRect(0, 0, getWidth(), getHeight()); 
                graphics.setColor(mTextColor); 
                super.paint(graphics); 
        } 
    }
Offline  
Old 03-03-2010, 05:29 PM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2009
Model: 8300
PIN: N/A
Carrier: Rogers
Posts: 43
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

nevermind... figured it out. Change one of the lines to :

Code:
super(text,Field.NON_FOCUSABLE);
Still trying to understand the super() method
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

DELL 725-10263 / 331-1310 / KT74N Lamp manufactured by DELL
$217.54
DELL 725-10263 / 331-1310 / KT74N Lamp manufactured by DELL pictureDell OEM 3010 series 4 Color Toner Set CMYK, JH565, TH204, XH005, WH006 - New
$199.99
Dell OEM 3010 series 4 Color Toner Set CMYK, JH565, TH204, XH005, WH006 - New pictureGXM1W Dell Optiplex 7010 SFF Socket LGA1155 OEM Motherboard tested
$29.99
GXM1W Dell Optiplex 7010 SFF Socket LGA1155 OEM Motherboard tested pictureGenuine OEM Dell Ink Cartridge Color Black 7Y745 7Y743 Lot Of 4 +
$39.0
Genuine OEM Dell Ink Cartridge Color Black 7Y745 7Y743 Lot Of 4 + pictureDELL 725-BBBQ Lamp manufactured by DELL
$166.71
DELL 725-BBBQ Lamp manufactured by DELL picture






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