private String convertStateToString(int state) {
	        if (state == JFrame.NORMAL) {
	            return "NORMAL";
	        }
	        String strState = " ";
	        if ((state & JFrame.ICONIFIED) != 0) {
	            strState += "ICONIFIED";
	        }
	        //MAXIMIZED_BOTH is a concatenation of two bits, so
	        //we need to test for an exact match.
	        if ((state & JFrame.MAXIMIZED_BOTH) == JFrame.MAXIMIZED_BOTH) {
	            strState += "MAXIMIZED_BOTH";
	        } else {
	            if ((state & JFrame.MAXIMIZED_VERT) != 0) {
	                strState += "MAXIMIZED_VERT";
	            }
	            if ((state & JFrame.MAXIMIZED_HORIZ) != 0) {
	                strState += "MAXIMIZED_HORIZ";
	            }
	            if (" ".equals(strState)){
	                strState = "UNKNOWN";
	            }
	        }
	        return strState.trim();
	    }