This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "No Watch "No New topic
Author

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.


Mani
Quaerendo Invenietis
Jason Menard
Sheriff

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
Hi
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..
bye
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
 
Similar Threads
Frame Trouble
NetBeans IDE 5.5
Using an ActionListener to Close a Frame
i have a jfarame. i want to call a existing from when i click close button[default close button]
JFrame