if (headlessDisplay == null)
if ( headlessDisplay == null ) {
    public boolean isClosing() {        if (headlessDisplay == null)            return Display.isCloseRequested();        else            return false;    }