change Panel Color

I am having problem in changing color of panel according to user input in JTextField..I dont know what is wrong..please help me..
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

paintComponent never gets called, and even if it were, it would not work as you test against chars in the switch statement. Get rid of the paintComponent method, which should be paintComponents anyway. Set the background in actionPerformed.