JMenu fails to disappear when user clicks outside the JMenu................
I have implemented a JMenu within a JMenuBar everything runs fine. However, with this application and with all others I have seen when you click a JMenu leaving it open and then click anywhere on the title in Windows the JMenu remains open. Windows native programs dont do this and it is just a nuisance for a user to go and disable the JMenu by clicking it again.
Does anyone have a solution for this.
[422 byte] By [
amarsyed] at [2007-9-26 4:09:36]

I'm using an IDE (VAJ 3.5.3) which actually implements JDK 1.2.2 and I have the same problem. This is definitly a Bug.
The JMenu pops up and can be closed by clicking anywhere in the application but not by clicking on the title bar (i.e of the JFrame). I think the attributes of the title bar are native-coded and the bar itself is created by the OS, respectively. If you use 100% JAVA, there is nothing you can do about it at the moment.
Hi Simon,
good Idea! But this produces some funny behaviour. If you add a MouseListener to the JMenu and override the mouseExited() method with something like getJMenu().setPopupMenuVisible(false);
the JMenu would close before you can select a JMenuItem :)
Hi Johannes,
I checked this and it did not work. Then I read the bug evaluation (should have done this before): JAVA doesn't get any event from the title bar. The workaround is provided in 1.4 with
"non-decorated window frames and the ability to add user defined window decorations".
I don't know this stuff. Is there anybody who already has got experience with these new features?
As this new feature works... say you have a JInternalFrame you want to be "modal" well cause they are lightweight, that is inpossible. SO now you can set a JDialog to unDecordated() and implement the JInternalFrame paint methods, and produce a "JInternalFrame" that is "modal" (just an example) i just the "setUndecorated(false);" in my JXcalendar popup, it works bette rthan JWindow, cause it listens for all window events.
> Hi Johannes,
>
> I checked this and it did not work. Then I read the
> bug evaluation (should have done this before): JAVA
> doesn't get any event from the title bar. The
> workaround is provided in 1.4 with
> "non-decorated window frames and the ability to add
> user defined window decorations".
> I don't know this stuff. Is there anybody who already
> has got experience with these new features?