panel.getContext().setSelectionEnd(box); panel.getContext().setSelectionEndX(x+1);
    public void mousePressed(MouseEvent e) {        if(e.getComponent() instanceof HTMLPanel) {            panel = (HTMLPanel)e.getComponent();            Box box = panel.findBox(e.getX(),e.getY());            if(box == null) return;            // if box is text node then start selection            if(box instanceof InlineBox) {                int x = panel.findBoxX(e.getX(),e.getY());                panel.getContext().setSelectionStart(box);                panel.getContext().setSelectionStartX(x);                panel.repaint();            }        }    }