Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to remove a close button from the title bar of a window?



Alexander,

In out applications, we simply pick the 'most safe' choice when someone
closes a dialog via the 'close' button -- usually this means doing
the same as 'cancel'. Our logic is that 'cancel' has the least
side-effects, whereas 'Save' / 'Dont Save' will change/lose data, and
'Quit' will do just that...

Larry

On Thu, 18 Mar 2004, Alexander Lamb wrote:

| Hello,
|
| I have a JDialog which is opened as modal.
| I need the title bar to display something and enable the user to move the window around. I also want to allow resizing.
| However, I don't want to allors closing with the close button, but only from a JButton I implemented.
|
| In the constructor I do:
|
| setUndecorated(false);
| getRootPane().setWindowDecorationStyle(JRootPane.NONE);
|
| The problem is that if I use setUndecorated(true), I also loose the title bar, the resizing and moving capability.
|
| I found nowhere a setting which would say something like:
|
| isCloseButtonEnabled(false) for example.
|
| Thanks,
|
| Alex
| _______________________________________________
| java-dev mailing list | email@hidden
| Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
| Do not post admin requests to the list. They will be ignored.
|

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Larry Nussbaum Imagination
email@hidden is more important than
Knowledge
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >How to remove a close button from the title bar of a window? (From: Alexander Lamb <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.