Point rootOnScreen; rootOnScreen = SwingUtilities.getRoot(invoker).getLocationOnScreen(); Point invokerOnScreen = invoker.getLocationOnScreen();  int popupX = (invokerOnScreen.x - rootOnScreen.x) + x; int popupY = (invokerOnScreen.y - rootOnScreen.y) + y;  setLocation(popupX , popupY);
Point p = new Point(x, y); SwingUtilities.convertPointToScreen(p, component); setLocation(p.x, p.y);
  public void show(Component component, int x, int y)  {    setInvoker(component);    Point rootOnScreen;    rootOnScreen = SwingUtilities.getRoot(invoker).getLocationOnScreen();    Point invokerOnScreen = invoker.getLocationOnScreen();        int popupX = (invokerOnScreen.x - rootOnScreen.x) + x;    int popupY = (invokerOnScreen.y - rootOnScreen.y) + y;        setLocation(popupX , popupY);    setVisible(true);  }