aspose file tools*
The moose likes Beginning Java and the fly likes disabling MAXIMIZE button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "disabling MAXIMIZE button" Watch "disabling MAXIMIZE button" New topic
Author

disabling MAXIMIZE button

GIRISH L
Greenhorn

Joined: Dec 05, 2000
Posts: 6
hello friends,
this is my first postin and i want to know if there is any means of disabling the maximize button in a frame or jframe
it would be very helpfull if someone can help me out in this
thank u all and bye
Matthew Jones
Ranch Hand

Joined: Dec 21, 2000
Posts: 68
Yes there is.
For a frame, you can user the line:
setResizable(false);
For a Jframe, I believe it is the same, but not sure.
GIRISH L
Greenhorn

Joined: Dec 05, 2000
Posts: 6
thanks for the reply,
but if i do that even the minimize button will be disabled
thank u
Peter Tran
Bartender

Joined: Jan 02, 2001
Posts: 783
Girish,
You wrote, "but if i do that even the minimize button will be disabled." And so it should be. If you invoke setResizable(false);, then the application shows the (default) maximum window size. If you want a smaller window size, then you should set your window size accordingly. Why would you want to enable the minimize button without the ability to maximize your Frame? It doesn't make sense. If you notice, the maximize button changes to a minimize button when invoked.
Okay, imagine me as your User. I start your application. The window/frame is displayed to me. And the minimize button is enable (somehow you hacked the JDK to make it possible). I then click on the Minimize button and the Window shrinks accordingly. Now as a naive User I'm not happy with the new smaller size, so I want to go back to the original "maximize" application size. But I can't. I get frustrated and refuse to use your application ever again. I then get on a forum like JavaRanch and tell everyone how horrible your application is, because it forces me to use it in a certain manner. No one else buys your application, and you go bankrupt. Get the ideal?
-Peter
GIRISH L
Greenhorn

Joined: Dec 05, 2000
Posts: 6
thanks!
but what i meant by disabling max button is : it should not be highlighted i.e user should not modify the size of frame!
minimising is nothing but iconifying it;
please suggest me methods so that maximise button is not highlighted!
thanks in advance!
bye giri!
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
"GIRISH L",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please choose a new name which meets the requirements.
Thanks.

Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
jQuery in Action, 2nd edition
 
subject: disabling MAXIMIZE button