Switch to full style
Java2 codes,problems ,discussions and solutions are here
Post a reply

Help needed in Color class

Fri Oct 24, 2008 9:01 pm

now i want to change the back ground color of my JPanel depending on the
string selected. e.g. if blue is selected then bgcolor will be blue.. etc. i
m trying to use Color.getColor("String-here") method but its not working
kindly suggest..



Re: Help needed in Color class

Fri Oct 24, 2008 9:04 pm

use this:

Map hm = *new* HashMap();
hm.add("blue", *new* Color(Color.BLUE));
String blue_color= "blue";
xxx.setColour( (Color) hm.get(blue_color) );
also test Color.decode method.

Post a reply
  Related Posts  to : Help needed in Color class
 help needed     -  
 Java help needed     -  
 i am using NetBeans 7.0, HELP NEEDED - URGENT     -  
 Help needed in website design     -  
 VBA / Excel programmer needed     -  
 Nanny/Housekeeper and driver/Gardener needed in UK     -  
 Define class helper class to check the method existance     -  
 java abstract class,concrete class and interface     -  
 relationship between the Canvas class and the Graphics class     -