This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

No 'close' in a JFrame  RSS feed

 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Swing / JFC / AWT forum. Please post followups there.
 
narayana murthy pedapudi
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!