aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Disable JFileChooser Maxmize button in Mac Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Disable JFileChooser Maxmize button in Mac" Watch "Disable JFileChooser Maxmize button in Mac" New topic
Author

Disable JFileChooser Maxmize button in Mac

Dilshan Edirisuriya
Ranch Hand

Joined: Apr 22, 2006
Posts: 299
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.


Dilshan Edirisuriya SCJP1.4, SCWCD1.4, SCBCD 5
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

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?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Dilshan Edirisuriya
Ranch Hand

Joined: Apr 22, 2006
Posts: 299
In windows it does not but in Mac there is a maximize button.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

I wasn't aware of that
You can override the JFileChooser#showDialog() and make the dialog non resizable.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
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

Joined: Jul 26, 2007
Posts: 9990
    
    7

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

Joined: Jun 09, 2003
Posts: 4632
> 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

Joined: Jan 10, 2002
Posts: 60057
    
  65

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).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dilshan Edirisuriya
Ranch Hand

Joined: Apr 22, 2006
Posts: 299
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disable JFileChooser Maxmize button in Mac
 
Similar Threads
JFrame problems.....
Disabling minimize and maximie button
How do you maximize on frame load?
Disabling the close and maximize icons.....
How to disable maximise button of jframe