List of usage examples for javax.swing.event HyperlinkEvent getSourceElement
public Element getSourceElement()
Element
that corresponds to the source of the event. From source file:net.java.sip.communicator.impl.gui.main.chat.ChatConversationPanel.java
/** * Opens a link in the default browser when clicked and shows link url in a * popup on mouseover./*from w ww.j a v a 2 s .c o m*/ * * @param e The HyperlinkEvent. */ public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ENTERED) { String href = e.getDescription(); this.isCurrentHrefImg = e.getSourceElement().getName().equals("img"); this.currentHref = href; } else if (e.getEventType() == HyperlinkEvent.EventType.EXITED) { this.currentHref = ""; this.isCurrentHrefImg = false; } }