コード例 #1
0
ファイル: DialogHelp.java プロジェクト: XRen615/QuantMinerAPI
  public void hyperlinkUpdate(HyperlinkEvent event) {
    HTMLDocument documentHTML = null;

    if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
      m_sPageCourante = event.getURL().toString();

      if (event instanceof HTMLFrameHyperlinkEvent) {
        documentHTML = (HTMLDocument) jEditorPaneHTML.getDocument();
        documentHTML.processHTMLFrameHyperlinkEvent((HTMLFrameHyperlinkEvent) event);
      } else ChargerPageActive();
    }
  }
コード例 #2
0
ファイル: BrowserFrame.java プロジェクト: haleyjd/Browsar
  // implemented for HyperlinkListener
  public void hyperlinkUpdate(HyperlinkEvent e) {
    if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
      JEditorPane ep = (JEditorPane) (e.getSource());

      // handle frame events properly
      if (e instanceof HTMLFrameHyperlinkEvent) {
        HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent) e;
        HTMLDocument doc = (HTMLDocument) (ep.getDocument());
        doc.processHTMLFrameHyperlinkEvent(evt);
      } else // handle normal links
      {
        try {
          URL currentLoc = new URL(location);
          URL newLoc = new URL(currentLoc, e.getDescription());

          setBrowserLocation(newLoc.toString());
        } catch (MalformedURLException malUrl) {
          JOptionPane.showMessageDialog(
              this, "Malformed URL", "Browser Error", JOptionPane.ERROR_MESSAGE);
          return;
        }
      }
    }
  }