I have an application of which the main GUI is a JFrame and I require that the 'close' (X) button be disabled. I have used the setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE)which serves the purpose but is a little confusing to users who complain that "the close button doesn't work". Does anyone know how I can "grey out" the close button. I am assuming that it is a regular JButton and if I could get a reference to it I could use the setEnabled(false) method (derived from java.awt.Component) which would, I think do what I wish, but how do I get that reference ???.