I have a window (derived from JFrame) and I want to disable the close button during certain operations which are not interruptible. I know I can make the button not do anything (or call a handler in a WindowListener) by calling
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
but I would like to make it clear visually that it is pointless to click it.