protected void showInfoPopup(String info, int x, int y) { JPanel content = new JPanel(); content.add(new JLabel(info)); content.setBorder(BorderFactory.createLineBorder(Color.BLACK)); Point location = getLocationOnScreen(); location.x += x + 5; location.y += y + 5; popup = PopupFactory.getSharedInstance().getPopup(this, content, location.x, location.y); popup.show(); }
public void hideInfo() { if (popup != null) popup.hide(); }