The method ispublic void setVisible(boolean b)so you need to specify the parameter (whether true or false) in the methodsetVisible.For your case, it will besetVisible(true);