use this code to toggle your panels visibility
replace yourpanel with your panel pointer

yourpanel.flags |= VISIBLE; // your panel will be visible

yourpanel.flags &= ~VISIBLE; // your panel will not be visible