private static final Color not working...
Posted on 2004-10-05
I have created a class called Board, which is to represent a the board for a board game. I want to set the color of the board as a constant, so that any time i want to change the board color, i can do so in one location. I also want all instances of the board class to use this same color.
I assumed that the best way to do it would be similarly to how it is defined in Color.java, and did so in the following way:
private static final Color BOARD_COLOR = new Color(255, 255, 175);
However, when running the program, it draw using a pale offwhite color, regardless of what numbers I use in new Color(). Even when I set it equal to Color.cyan, it still draws the same pale offwhite.
What am I doing wrong? My other uses of private static final seemed to work without difficulty...is there something special about colors?