jQuery in Action, 3rd edition
The moose likes Swing / AWT / SWT and the fly likes No 'close' in a JFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "No Watch "No New topic

No 'close' in a JFrame

Ransika deSilva
Ranch Hand

Joined: Feb 18, 2003
Posts: 524
Hello world,
I just want to know for JFrame is there a possible way of removing the close(the cross) in the frame. I mean like 'setResizable(false) for not allowing the frame to resize.
Thank you..

SCJP 1.4, SCMAD 1.0<br />SCWCD, SCBCD (in progress)
Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140
Which Java version you are using?
If you are using JDK 1.4 or above, try setUndecorated(true) method (I have never tried, check it out).
If you are using versions below 1.4, then you have to use JWindow instead of a JFrame.

Quaerendo Invenietis
Jason Menard

Joined: Nov 09, 2000
Posts: 6450
Moved to the Swing / JFC / AWT forum. Please post followups there.
narayana murthy pedapudi
Ranch Hand

Joined: Jul 23, 2003
Posts: 42
Framename.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE );
it will display the cross mark but won't do any action..i mean it won't close....if u want to remove that button there is no option in java..
by the by why do u want to do that..let me know the necessity..
u can mail me even to p_narayanamurthy@yahoo.com
I agree. Here's the link: http://aspose.com/file-tools
subject: No 'close' in a JFrame
It's not a secret anymore!