Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Closing Maximizing and Minimizing Buttons

 
Mabel Ahmad
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to get rid of the little Minimizing, Maximizing, and Closing buttons at the top right corrner of a window?

[-][_][X] <-- those buttons
 
pravinth Ganesan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes,
You can handle the WindowClosing,minimize,maximize events -u can write code in these events-so nothing will happen when the max,min,close-buttons of the frame is pressed.
if u want a different frame without buttons,with different design-why not you can go for IBM's IFrame(extends JFrame)
http://www-128.ibm.com/developerworks/java/library/j-iframe/
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! You can get rid of the minimize,maximize by using a JDialog istead of a JFrame

 
Mabel Ahmad
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot guys for the information and help!! Really appreciated!!

Mathias how would you only get rid of the close button but keep the other 2 buttons?

Thanks again!
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't.... you can however do nothing on close



This will make the JFrame not closing on the x mark.


you can altso set the setUndecorated(true); on the JFrame. This will remove all the options.

You can use the setResizable(false); if you want to enable a user to maximize a Jframe

// Mathias
[ February 19, 2006: Message edited by: Mathias Nilsson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic