• Post Reply Bookmark Topic Watch Topic
  • New Topic

Popup menu appears outside the frame

 
Anusha Bhatnagar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my application,a few internal frames open up.and in each frame,a graph is laid out.(I'm using JGraph).So I have set up a popmenu for every vertex of my vertex. It works absolutely fine with small graphs where I dont have to scroll.My problem is that when the graph gets bigger i.e when I have to scroll down, the pop menu appears somewhere else(not even within the internal frame sometimes) and obviously does not work.

Here's my code.I have tried using getXOnScreen too but the problem still persists.

could anyone explain to me what i'm doing wrong?

thanks
 
Rob Camick
Ranch Hand
Posts: 2700
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe you need the coordinates relative to the viewport.

You can use SwingUtilities.convertPoint(...) for this.
 
Anusha Bhatnagar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what I've done and it does not work too

 
Rob Camick
Ranch Hand
Posts: 2700
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post your SSCCE that demonstrates the problem.

And since JGraph is not part of the JDK you will need to change your code so simulate the problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!