public void showHint(LBNode n) {        

        if(intfHint.isVisible() || n.getHint().trim().equals("")) return;        

        intfHint.setTitle(n.getLabel());

        hintNode=n;

        hintWidth = n.getHintWidth();

        if (n.getHintIsHTML()) {

            tpHint.setEditorKit(new HTMLEditorKit());

            URL documentBase = tgLinkBrowser.getDocumentBase();            

            if (documentBase!=null) ((HTMLDocument) tpHint.getDocument()).setBase(documentBase);

        }

        else {

            tpHint.setEditorKit(new StyledEditorKit());

        }

        tpHint.setText(n.getHint());

                        

        int ix = (int) n.drawx;

        int iy = (int) n.drawy;             

       

        spHint.getVerticalScrollBar().setVisible(false);

        hintHeight = n.getHintHeight();

        if(hintHeight<LBNode.MINIMUM_HINT_HEIGHT) {

            //Set the height to 10, because we don't care what it is.  We only need to set the

            //width so that hintHight can be correctly determined.

            tpHint.setSize(new Dimension(hintWidth-16,10));

            hintHeight = tpHint.getPreferredScrollableViewportSize().height+40;             

        }

        int topEdge = 0;

        int tgPanelHeight = tgPanel.getSize().height;

        int nodeHeight = n.getHeight()/2;

        if(iy>tgPanelHeight/2 || iy-nodeHeight>hintHeight) {

            hintHeight=Math.min(iy-nodeHeight,hintHeight);                

            topEdge = iy-hintHeight-nodeHeight;

        }

        else {

            hintHeight=Math.min(tgPanelHeight-iy-nodeHeight,hintHeight);                

            topEdge = iy + nodeHeight;

        }

        int leftEdge=ix-hintWidth/2;

        leftEdge = Math.max(Math.min(leftEdge,tgPanel.getWidth()-hintWidth),0);

        

        intfHint.setSize(new Dimension(hintWidth,hintHeight));

        intfHint.setLocation(leftEdge,topEdge);  

        intfHint.setVisible(true);                              

        

    }