S
Simon Niederberger
Hi
I'm currently implementing a swing GUI which uses a glass pane. My problem
is with the MouseListener:
I intercept the mouse events on the glass pane, and dispatch events to the
underlying components when necessary. I looked at an example in the Sun Java
forum, where they also use a JMenuBar. Here's my problem:
A mouse click on the JMenuBar is recognized as such, as the y-coordinate of
the event is negative. However, when the menu list (JMenu) is displayed, a
click on a menu item is not dispatched to the JMenuBar, as the coordinates
show to the JPanel just below the menu bar.
Does anyone have a solution to this?
Thanks
Simon
Posted to: comp.lang.java.programmer; comp.lang.java.gui
I'm currently implementing a swing GUI which uses a glass pane. My problem
is with the MouseListener:
I intercept the mouse events on the glass pane, and dispatch events to the
underlying components when necessary. I looked at an example in the Sun Java
forum, where they also use a JMenuBar. Here's my problem:
A mouse click on the JMenuBar is recognized as such, as the y-coordinate of
the event is negative. However, when the menu list (JMenu) is displayed, a
click on a menu item is not dispatched to the JMenuBar, as the coordinates
show to the JPanel just below the menu bar.
Does anyone have a solution to this?
Thanks
Simon
Posted to: comp.lang.java.programmer; comp.lang.java.gui