JPopupMenu position changing
- From: Martin Buerger <mbuerger_DELETETHIS_@xxxxxxxxxxxxxxxxx>
- Date: Sun, 27 Nov 2005 21:18:40 +0100
Hello,
the situation:
a JPanel containing a JSplitPane with two JScrollPanes; one of the
JScrollPanes has a JTree, the other one a JTable in it. Each, JTree and
JTable have their own MouseListener which pops up with a certain popup menu
(add node, delete node // add attribute, delete attribute). This whole
construct is used in some other program (JFrame).
The problem: the position of the JPopupMenus isn't the same where I clicked
with the mouse (mouseevent.(getX()|getY()). I solved this partly: when I
click in the pane with the JTree the actual position of the click =
frame.getX() + mouseevent.getX(), frame.getY() + mouseevent.getY()
This works for the upper pane. For the lower one with the JTable this
doesn't work. The popup menu is always situated somewhere above the divider
of the two panes. I noticed changing the location of the divider changes
the position of the popup menu even if I click at the exact same position
on the screen without moving anything except the divider.
Well, I'm stuck with this (java version "1.5.0_04", Linux). Any suggestions?
Thank you,
Martin
.
- Follow-Ups:
- Re: JPopupMenu position changing
- From: Kari Ikonen
- Re: JPopupMenu position changing
- Prev by Date: Re: moving (JTable) columns
- Next by Date: Re: JPopupMenu position changing
- Previous by thread: moving (JTable) columns
- Next by thread: Re: JPopupMenu position changing
- Index(es):
Relevant Pages
|
|