There are 3 code examples for javax.swing.event.HyperlinkEvent.
The API names are highlighted below.
You can use
button
to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.
Project Name: druid Package: org.dlib.gui.html
Source Code: HtmlPanel.java (Click to view .java file)
Method Code:
public void hyperlinkUpdate(HyperlinkEvent e){
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
JEditorPane jep=(JEditorPane)e.getSource();
if (e instanceof HTMLFrameHyperlinkEvent) {
HTMLFrameHyperlinkEvent evt=(HTMLFrameHyperlinkEvent)e;
HTMLDocument doc=(HTMLDocument)jep.getDocument();
doc.processHTMLFrameHyperlinkEvent(evt);
}
else {
String url=e.getURL().toString();
if (al != null) al.actionPerformed(new ActionEvent(url,ActionEvent.ACTION_PERFORMED,actCmd));
setPage(url);
}
}
}
Project Name: jbidwatcher Package: com.jbidwatcher.ui.util
Source Code: Hyperactive.java (Click to view .java file)
Method Code:
public void hyperlinkUpdate(HyperlinkEvent e){
if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
String desc=e.getDescription();
if (desc != null) if (desc.startsWith("#")) {
_pane.scrollToReference(desc.substring(1));
}
else if (desc.startsWith("/")) {
MQFactory.getConcrete("user").enqueue(desc.substring(1));
}
else {
try {
MQFactory.getConcrete("browse").enqueue(e.getDescription());
}
catch ( Exception except) {
JConfig.log().handleException("Launching URL " + e.getDescription() + " failed: "+ except,except);
JOptionPane.showMessageDialog(null,"Failed to launch link.","Link error",JOptionPane.PLAIN_MESSAGE);
}
}
}
}
Project Name: weka Package: weka.gui
Source Code: PackageManager.java (Click to view .java file)
Method Code:
public void hyperlinkUpdate(HyperlinkEvent event){
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
try {
if (event.getURL().toExternalForm().endsWith(".zip") || event.getURL().toExternalForm().endsWith(".jar")) {
}
else {
if (m_browserHistory.size() == 0) {
m_backB.setEnabled(true);
}
m_browserHistory.add(m_infoPane.getPage());
m_infoPane.setPage(event.getURL());
}
}
catch ( IOException ioe) {
}
}
}