fixed the switch issue

take a look at this link maybe

http://docs.oracle.com/javase/tutorial/uiswing/events/listselectionlistener.html