Removing the default blue color

I have a custom Button field created, when the button is on focus by default, the blue background is approaching, I want to remove that blue background. in fact i am placing an image on a button and there is a certain area in the image that is transparent. when this custom button has focus, a blue background is displayed. I want to remove this blue background.

Thank you very much

+2


a source to share


2 answers


Override method



protected void drawFocus(Graphics graphics, boolean on) {
        if (on) {
                 //draw your own custom focus.
                }
            }

      

+10


a source


override method

public void onFocus(int direction) {}

      



and don't call super.onFocus in it

0


a source







All Articles