dev
dev

Reputation: 11

blackberry remove default color

How do I remove default BLUE focus color in Blackberry? I have one bitmap field and it is focusable. When I click on that image, transparent portion of that image focus with BLUE color and I want to remove that.

Upvotes: 0

Views: 961

Answers (2)

iKushal
iKushal

Reputation: 2889

This is a method by which you can remove the default color of focus. If you want to set your own color then you need to give body.

protected void drawFocus(Graphics paramGraphics,boolean paramBoolean) 
{
    //...
}

Upvotes: 3

Jisson
Jisson

Reputation: 3725

You can Try the follwing code

        Bitmap b = Bitmap.getBitmapResource("test.png"){

            protected void onFocus(int direction)
            {
                backgroundColour = highlightColour;
                invalidate();
            }

            protected void onUnfocus()
            {
                backgroundColour = Color.GRAY;
                invalidate();
            }

            protected void paint(Graphics graphics)
            {
                graphics.setColor(backgroundColour);
            }
        }

Upvotes: 0

Related Questions