Пример #1
0
  synchronized void popup(int x, int y, Component component, String text) {

    invalidate();
    textLabel.setText(text);
    textLabel.setForeground(ToolTipManager.getInstance().foreground);
    textLabel.setBackground(ToolTipManager.getInstance().background);
    validate();
    pack();
    try {
      if (x != -1 && y != -1) {
        setLocation(x + 8, y + 8);
      } else {
        Point p = component.getLocationOnScreen();
        Dimension s = component.getSize();
        setLocation(p.x + 8, p.y + s.height + 8);
      }
      setVisible(true);
      toFront();
      lastShow = System.currentTimeMillis();
      dismissed = false;
    } catch (IllegalComponentStateException icse) {

    }
  }