English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am trying to create a variable to store a color in, either red or blue. i have already imported java.awt. This is what i have, but it won't compile...

Color color = new Color(Color.blue);

2006-11-12 06:30:36 · 1 answers · asked by snoboarder2k6 3 in Computers & Internet Programming & Design

1 answers

Color.blue is a static instance of Color that is set to the color blue. You don't need to instantiate a new Color object to use it, just say:

Color color = Color.blue;

2006-11-12 06:34:22 · answer #1 · answered by watsonc64 3 · 2 0

fedest.com, questions and answers