1 import javax
.swing
.JEditorPane
;
2 import javax
.swing
.event
.HyperlinkListener
;
3 import javax
.swing
.event
.HyperlinkEvent
;
4 import javax
.swing
.text
.Document
;
11 throws java
.io
.IOException
13 // maDocument = getEditorKit().createDefaultDocument();
14 super ("http://localhost");
17 // setPage (new URL ("http://www.spiegel.de"));
23 final JEditorPane finalPane
= this;
24 addHyperlinkListener (new HyperlinkListener()
26 public void hyperlinkUpdate (HyperlinkEvent e
)
30 if (e
.getEventType() == HyperlinkEvent
.EventType
.ACTIVATED
)
31 finalPane
.setPage (e
.getURL());
33 catch (java
.io
.IOException ex
)
35 ex
.printStackTrace(System
.err
);
41 public void appendText (String sText
)
45 maDocument
.insertString (maDocument
.getLength(), sText
, null);
47 catch (javax
.swing
.text
.BadLocationException e
)
51 private Document maDocument
;