views:

82

answers:

1

I have a dateField and when I iterate with the cursor over the various sub sections (date month year, etc) of the dateField the focus color by default is blue. When I unfocus the dateField the item that was selected highlight turns white. Which is fine, except my text is white with a black background. This makes it look poor as now there is a date field with one of the sub fields looking like a white rectangle.

I tried painting the the background black which solved the blue/white highlight, but it did so by offering no highlight at all. So you can no longer tell when you have focus on the field.

Is there a way to override the highlight colors for the sub parts of a dateField?

A: 

Found a workaround finally. Whenever it tries to draw white I change to black then reset the normal blue for when it highlights again.

public void paint(Graphics g)
        {   
            if(g.getBackgroundColor() == Color.WHITE) { 
                g.setBackgroundColor(Color.BLACK);
                g.clear();
                g.setBackgroundColor(Color.BLUE);
            }
            g.setColor(Color.WHITE - HistoricalBottomBar.BG_COLOR);
            super.paint(g);
        }
Joe