Box box = panel.findBox(evt.getX(), evt.getY()); if (box == null) { return;
Element elem = box.getRealElement(); if(elem == null) return;  if (panel.getContext().getRenderingContext().getLayoutFactory().isLink(elem)) { linkClicked(box,evt);
    public void mouseReleased(MouseEvent evt) {        Box box = panel.findBox(evt.getX(), evt.getY());        if (box == null) {            return;        }        u.p("pressed " + box);        if (box.node != null) {            Node node = box.node;            if (node.getNodeType() == node.TEXT_NODE) {                node = node.getParentNode();            }            if (panel.getContext().getRenderingContext().getLayoutFactory().isLink(node)) {                u.p("clicked on a link");                box.clicked = true;                box.color = new Color(255, 0, 0);                panel.repaint();                followLink((Element) node);            }        }    }