• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disable JFileChooser Maxmize button in Mac

 
Dilshan Edirisuriya
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to disable the maximize button in the mac. And I want to do that only to some of the frames. Actually my requirement is to disable the maximize functionality in JFileChooser.
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dilshan Edirisuriya:
I want to disable the maximize button in the mac. And I want to do that only to some of the frames. Actually my requirement is to disable the maximize functionality in JFileChooser.


JFileChooser has a maximize button?
 
Dilshan Edirisuriya
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In windows it does not but in Mac there is a maximize button.
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wasn't aware of that
You can override the JFileChooser#showDialog() and make the dialog non resizable.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't use a mac, but this might be worth a try

*before* creating the filechooser, put this line
JDialog.setDefaultLookAndFeelDecorated(true);
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Dunn:
I don't use a mac, but this might be worth a try

*before* creating the filechooser, put this line
JDialog.setDefaultLookAndFeelDecorated(true);


But this will affect all dialogs. The OP wants to
And I want to do that only to some of the frames. Actually my requirement is to disable the maximize functionality in JFileChooser.

Also the LAF of the Dialogs is going to be different that the other components if the SystemLookAndFeel has been set.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> But this will affect all dialogs.

only if it's not reset to false after the fileChooser is shown.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to be complete (or perhaps pedantic) there is no Maximize button in OS X. The green button on the caption bar is an "Optimize Size" button which cause the application to adjust the window to what it feels is the optimum size for the contents (which is rarely full-screen).
 
Dilshan Edirisuriya
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I agree Bear there is no maximize button in MAC. I was referring to that "Optimize Size" button which acts like a resize button. So is there anything I can do for that?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic