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, 255, 0); panel.repaint(); } }
    public void mousePressed(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, 255, 0);                panel.repaint();            }        }    }