For convenience, the Color class pre-defines thirteen static Color constants |
Use a constant anywhere a Color is required: setBackground( Color.red ); setForeground( Color.black ); ... g.setColor( Color.white ); |
(Why did the Java designers neglect to capitalize the Color constants?) |