• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JFrame disable minimize button (jdk1.3)

 
Eric Espares
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Thanks,
Eric
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Eric Espares
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gregg,

Thanks for your inputs.

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

Thanks,
Eric
 
R.Joe
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
So u take all the jframe in an array
regards ,
ravi
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic