The highlighing for a field color can be customized

Please let me know if we can change the highlight color for a label to a color we want it is to tell when any field label is highlighted by default the labelfield highlighted turns dark blue as shown below:

This dark blue color can be changed at the light blue or green, or any other custom color. Please help me on this matter as soon as possible. If necessary provide all code snippet as I am new blackberry development.

Below is some code that should go you.  Note that this code is untested.  It has been cut and paste of the labour code, but I edited to get rid of redundant things / have fun.

LabelField lb  = new LabelField("Label",  LabelField.FOCUSABLE ) {
    boolean _inFocus = false;
    public void onFocus(int direction) {
        _inFocus = true;
        super.onFocus(direction);
        this.invalidate();
    }
    public void onUnfocus() {
        _inFocus = false;
        super.onUnfocus();
        this.invalidate();
    }
    public void paint(Graphics g) {
        if ( _inFocus ) {
            g.setBackgroundColor( 0x0000FF00 );
        } else {
            g.setBackgroundColor( 0x00FF0000 );
        }
        g.clear();
        super.paint(g);
    }
};

Just noticed there is an interesting variation on this code in this post:

http://supportforums.BlackBerry.com/T5/Java-development/focus-issue/TD-p/374304

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for

  • History of Firefox help

    Yesterday, I asked a question at this place in Firefox Help and two people responded with answers. I want to examine the responses again but cannot find them. How can I find my 'story' of questions / answers in Firefox help?Thanks to all who can help

  • Equium A100-306 - using an LCD TV only

    My laptop has a broken LCD and I want to continue to use the computer with my Sony Bravia TV, acting as a monitor. I connected a VGA cable between the two devices and have not managed to get the computer to display on the TV screen despite pressing a

  • If my iPhone is brick, can I replace it with the apple warranty?

    I'm still under warranty of one year of iPhone. If my iPhone gets bricked can I replace? There is no jailbreaking or other malicious activities. Also I was jailbroken in the past, I'm not now of course, but they can follow the which? Thank you.

  • Windows update web page does not load

    It loads this 72.14.205.100 then said that it can not display the page is not automatically updated or the other I tried to clear browser, disable updates, change software distribution / download to download.old all ideas

  • E1-571 keyboard problem

    Hello. I have a problem with a key (en) I push on it is difficult to make this work and it's just annoying me... Any fix for that? [word filter avoidance]