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 Lamb wrote:
| I have a JDialog which is opened as modal.
|
| ...
|
| I found nowhere a setting which would say something like:
|
| isCloseButtonEnabled(false) for example.

There isn't one. Sun, in its infinite wisdom, believes that the close button on a dialog must *always* be enabled, no matter what the application programmer wants. They believe this despite regular inquiries on Sun's *own* forums asking how to disable the close box on a *Windows* dialog. (There may even be bug reports on it; I didn't check.)

Your choices:
* Arrange to ignore clicks on the button (and, probably, the user
pressing command-W)
* Figure out what action the user is most likely to expect to happen
when the dialog is closed, and do that.

If you pick the second choice, be warned that whatever you make happen will be the wrong choice for a non-trivial subset of your users. This is why the pre-Aqua Interface Guidelines explicitly stated that dialogs with "OK" *and* "Cancel" buttons should not have a close box. (The Aqua Guidelines are silent on the subject, but none of the example dialogs have close boxes.)

Best advice: avoid modal dialogs whenever possible. Does your dialog really *have* to be modal?

Glen Fisher
_______________________________________________
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.