> ...
> frame.getX() + mouseevent.getX(), frame.getY() + mouseevent.getY()
> ...
Coordinates in the MouseEvent are relative to component receiving the event.
If coordinates are required to be converted between coordinate spaces, then
SwingUtilities.convertX() -methods can be used.
However, best fix would be just to use component receiving the mouseevent as
"invoker" for JPopup.show().
The fact that it seemed to "work" for uppper pane, is just because it's
origin happened to be at (0 0). If there would have been e.g. menubar
visible in JFrame, then popup location would have been failing also for it.

Signature
KI -- http://kari.world.dy.fi
Martin Buerger - 27 Nov 2005 21:59 GMT
> However, best fix would be just to use component receiving the mouseevent
> as "invoker" for JPopup.show().
I'm not sure if I understand you right: I have to receive the mouseevent via
another Component, thus I've to add the MouseListener to this other
Component (JFrame)? Or do you mean, JTree|JTable receive the mouseevent but
delegate it somehow(?) somewhere(?)?
Thank you,
Martin
Martin Buerger - 28 Nov 2005 21:01 GMT
> Coordinates in the MouseEvent are relative to component receiving the
> event. If coordinates are required to be converted between coordinate
> spaces, then SwingUtilities.convertX() -methods can be used.
The only way I found to solve this was to use
SwingUtilities.convertPointToScreen(). Thanks for your help.
Ciao,
Martin