Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
RE: How to remove a close button from the title bar of a window?
[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?



Hello Alex

We created our on Dialog which extends Jdialog.

Within our own class we overridden
protected void processWindowEvent(WindowEvent e).
Since then no closing events happend any more and our modal dialog stays as long as we wish.

Hope this helps.

Regards,

Chris


-----Original Message-----
From: email@hidden [mailto:email@hidden] On Behalf Of Alexander Lamb
Sent: Donnerstag, 18. Mdrz 2004 14:19
To: email@hidden
Subject: How to remove a close button from the title bar of a window?


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




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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.