@Override
    protected void paintComponent(Graphics g) {
      if (myImage != null) {
        UIUtil.drawImage(g, myImage, 0, 0, null);
      }
      else if (myKey != null) {
          ToolTipDetails details = calcToolTipDetails(myKey);
          if (details != null) {
            Graphics2D g2d = (Graphics2D)g.create();
            try {
              if (details.clip != null) {
                g2d.clip(details.clip);
              }
              details.painter.accept(g2d);
            }
            finally {
                g2d.dispose();
            }
        }
      }
    }
@Override
    protected void paintComponent(Graphics g)