currentTip.setVisible(true); currentTip.revalidate(); currentTip.repaint();
  void showTip()  {    if (!enabled || currentComponent == null || !currentComponent.isEnabled()        || (currentTip != null && currentTip.isVisible()))      return;    if (currentTip == null || currentTip.getComponent() != currentComponent        && currentComponent instanceof JComponent)      currentTip = ((JComponent) currentComponent).createToolTip();    Container parent = currentComponent.getParent();    Point p = currentPoint;    Dimension dims = currentTip.getPreferredSize();        if (parent instanceof JPopupMenu)        setLightWeightPopupEnabled(((JPopupMenu) parent).isLightWeightPopupEnabled());    else      setLightWeightPopupEnabled(true);               if (isLightWeightPopupEnabled())      {        JLayeredPane pane = ((JRootPane) SwingUtilities.            getAncestorOfClass(JRootPane.class, currentComponent)).            getLayeredPane();        // This should never happen, but just in case.        if (pane == null)          return;        if (containerPanel != null)          hideTip();                containerPanel = new Panel();        JRootPane root = new JRootPane();        root.getContentPane().add(currentTip);        containerPanel.add(root);        LayoutManager lm = containerPanel.getLayout();        if (lm instanceof FlowLayout)          {            FlowLayout fm = (FlowLayout) lm;            fm.setVgap(0);            fm.setHgap(0);          }        p = SwingUtilities.convertPoint(currentComponent, p, pane);        p = adjustLocation(p, pane, dims);                pane.add(containerPanel);        containerPanel.setBounds(p.x, p.y, dims.width, dims.height);        currentTip.setBounds(0, 0, dims.width, dims.height);        containerPanel.validate();        containerPanel.repaint();      }    else if (currentComponent.isShowing())      {                SwingUtilities.convertPointToScreen(p, currentComponent);        p = adjustLocation(p, SwingUtilities.getWindowAncestor(currentComponent),                            dims);                tooltipWindow = new JDialog();        tooltipWindow.setContentPane(currentTip);        tooltipWindow.setUndecorated(true);        tooltipWindow.getRootPane().                setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);        tooltipWindow.pack();        tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height);        tooltipWindow.show();        tooltipWindow.validate();        tooltipWindow.repaint();      }    currentTip.setVisible(true);    currentTip.revalidate();    currentTip.repaint();  }