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..
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.
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.