aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JFrame disable minimize button (jdk1.3) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFrame disable minimize button (jdk1.3)" Watch "JFrame disable minimize button (jdk1.3)" New topic
Author

JFrame disable minimize button (jdk1.3)

Eric Espares
Greenhorn

Joined: Apr 04, 2002
Posts: 12
Hi,

How can I disable the 'MINIMIZE' button of a JFrame in JDK1.3?

Thanks,
Eric
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

You can't. The only thing you can do is use a JWindow or a JFrame with setUndecorated(true) so that the title bar isn't there at all.

Just tried something else, but it's ugly. In the windowIconified method of the WindowListener you can setExtendedState(JFrame.MAXIMIZED_BOTH); Problem with this is it will maximize your app whether you want it to or not but more importantly you will see it minimize then maximize itself. Pretty ugly.
[ July 01, 2004: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
Eric Espares
Greenhorn

Joined: Apr 04, 2002
Posts: 12
Hi Gregg,

Thanks for your inputs.

One thing more. How do I iconify or deiconify a JFrame?

Thanks,
Eric
R.Joe
Ranch Hand

Joined: Jun 16, 2004
Posts: 31
Hello Eric,
for deiconified or iconified u can use the method
frame1.setExtendedState(0) or frame1.setExtendedState(1) along this u has to use
frame1.show() and frame1.toFront();
just simplecode is this
******************
if (frame1.getExtendedState()==1){
frame1.setExtendedState(0);
}
frame1.show();
frame1.toFront();
************
from this code it check if it is iconified it get deconified or do what u need
Regards,
Ravi
Eric Espares
Greenhorn

Joined: Apr 04, 2002
Posts: 12
Hi Ravi,

Thanks for you reply.

How about if I wish to iconify or deiconify two or more windows (all in JFrame) in one time?

Cheers,
Eric
R.Joe
Ranch Hand

Joined: Jun 16, 2004
Posts: 31
hello,
So u take all the jframe in an array
regards ,
ravi
 
 
subject: JFrame disable minimize button (jdk1.3)