Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / May 2004

Tip: Looking for answers? Try searching our database.

Handle JMenuBar with visible glass pane

Thread view: 
Simon Niederberger - 18 May 2004 21:54 GMT
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
Simon Niederberger - 19 May 2004 07:39 GMT
Here's a Java Forum entry which might help:

http://forum.java.sun.com/thread.jsp?thread=208887&forum=57&message=1431994

> Hi
>
[quoted text clipped - 15 lines]
>
> Posted to: comp.lang.java.programmer; comp.lang.java.gui
ak - 19 May 2004 08:15 GMT
> I'm currently implementing a swing GUI which uses a glass pane. My problem
> is with the MouseListener:
[quoted text clipped - 8 lines]
>
> Does anyone have a solution to this?

see http://www.physci.org/codes/sscce.jsp

--
http://uio.dev.java.net
http://reader.imagero.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.