151152153154155156157158159160161
} else if (location.y - sBounds.y + size.height > sBounds.height) { location.y = sBounds.y + Math.max(0, sBounds.height - size.height); } PopupFactory popupFactory = PopupFactory.getSharedInstance(); tipWindow = popupFactory.getPopup(component, tip, location.x, location.y); tipWindow.show(); isTooltipVisible = true; } }
299300301302303304305306307308
location.x = sBounds.x; } else if (location.x - sBounds.x + size.width > sBounds.width) { location.x = sBounds.x + Math.max(0, sBounds.width - size.width); } PopupFactory popupFactory = PopupFactory.getSharedInstance(); tipWindow = popupFactory.getPopup(component, tip, location.x, location.y); tipWindow.show(); tipShowing = true; }
424425426427428429430431
// move it off screen on the top if(yPos + h > scrn.height - 5) { yPos = Math.max(5, scrn.height - h - 5); } PopupFactory pf = PopupFactory.getSharedInstance(); return pf.getPopup(mv, sp, xPos, yPos); }
229230231232233234235236237238239240
private JPanel infoPanel; @Override public void actionPerformed(ActionEvent e) { Point p = MouseInfo.getPointerInfo().getLocation(); PopupFactory factory = PopupFactory.getSharedInstance(); if (popup != null) { popup.hide(); } popup = factory.getPopup(UserPane.this, infoPanel, p.x, p.y); popup.show(); }