• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Disable JFileChooser Maxmize button in Mac

 
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In windows it does not but in Mac there is a maximize button.
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wasn't aware of that
You can override the JFileChooser#showDialog() and make the dialog non resizable.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> But this will affect all dialogs.

only if it's not reset to false after the fileChooser is shown.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic