Disable JFrame minimize button

Pankaj Kumar Thapa picture Pankaj Kumar Thapa · Oct 28, 2012 · Viewed 29.4k times · Source

I am developing a tool for my laptop. I want to disable minimize button in the JFrame. I have already disabled maximize and close button.

Here is the code to disable maximize and close button:

JFrame frame = new JFrame();  
frame.setResizable(false); //Disable the Resize Button  
// Disable the Close button
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); 

Please, tell me how to disable minimize button.

Answer

MadProgrammer picture MadProgrammer · Oct 28, 2012

Generally, you can't, what you can do is use a JDialog instead of JFrame