Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable JFrame minimize button

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.

like image 634
Pankaj Kumar Thapa Avatar asked Oct 28 '12 07:10

Pankaj Kumar Thapa


1 Answers

I would recommend you to use jframe.setUndecorated(true) as you are not using any of the window events and do not want the application to be resized. Use the MotionPanel that I've made, if you would like to move the panel.

like image 147
Sorter Avatar answered Oct 16 '22 15:10

Sorter