Search code examples
javaswingjframeminimizewindowlistener

Override minimize of JFrame


I'm making a program with a logger. The logger has its own JFrame. I'm trying to override the reaction from clicking on the minimize-button of that frame. I would like the frame to either setVisible(false) or do the defaultCloseOperation (as i set that to hide earlier).

How should I do this? Thanks in advance


Solution

  • Use a JDialog instead of a JFrame. JDialogs don't have a minimize button.