Change the setVisible() method action