Einzelnen Beitrag anzeigen
Alt 22.11.2005, 18:14   #3
jak
Inventar
 
Registriert seit: 13.06.2001
Beiträge: 1.830


Standard

Wie gesagt, wenn dir einfaches HTML reicht geht's mit Swing:
Code:
JEditorPane editorPane=newJEditorPane();

editorPane.setPage(this.class.getResource("index.htm"));
editorPane.setEditable(false);
editorPane.addHyperlinkListener(new editorPane_hyperlinkListener());
editorPane.setPreferredSize(new Dimension(800,400));
Der HyperlinkListener sieht so aus:
Code:
class editorPane_hyperlinkListener
      implements HyperlinkListener {
    public void hyperlinkUpdate(HyperlinkEvent e) {
      if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
        JEditorPane pane = (JEditorPane) e.getSource();
        if (e instanceof HTMLFrameHyperlinkEvent) {
          HTMLFrameHyperlinkEvent  evt = (HTMLFrameHyperlinkEvent)e;
          HTMLDocument doc = (HTMLDocument)pane.getDocument();
          doc.processHTMLFrameHyperlinkEvent(evt);
        } else {
          try {
            pane.setPage(e.getURL());
          } catch (Throwable t) {
            t.printStackTrace();
          }
        }
      }
    }
jak
____________________________________
Join the DNRC | Godwin\'s Law (thx@stona)
Documentation is like sex: If it\'s good, it\'s very, very good. If it\'s bad, it\'s better than nothing.
\"In theory, theory and practice are the same. In practice, they are not\" (Lawrence Berra)
jak ist offline   Mit Zitat antworten