void (HyperlinkEvent e) { Element element = e.getSourceElement(); if (element == null) return; if (element.getName().equals("img")) return; if (e.getEventType() == HyperlinkEvent.EventType.ENTERED) { setUnderlined(true, element); } else if (e.getEventType() == HyperlinkEvent.EventType.EXITED) { setUnderlined(false, element); } }