boolean () { String actionCommand=menuItem.getActionCommand(); if( ("Close".equals(actionCommand))|| ("Minimize".equals(actionCommand))|| ("Restore".equals(actionCommand))|| ("Maximize".equals(actionCommand)) ){ return true; } else{ return false; } }