Changing the focus rect color for an EditField

private static class MyBasicEditField extends BasicEditField {

    public MyBasicEditField(long style) {

        super( style );
    }

    protected void drawFocus( Graphics graphics, boolean on ) {

        XYRect focusRect = new XYRect();
        getFocusRect( focusRect );

        if ( on ) {

            graphics.pushContext( focusRect, 0, 0 );
            graphics.setBackgroundColor( Colors.RED );
            graphics.clear();
            graphics.invert( focusRect );
            graphics.popContext();
        }

        paint( graphics );

        graphics.invert( focusRect );
    }
}
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© 2011 Metova, Inc.