merge the formfield patch from ooo-build
[ooovba.git] / toolkit / test / accessibility / TextLogger.java
blobe0ee56fd691dcd588abcb105e59bb43cbed4c0fd
1 import javax.swing.JEditorPane;
2 import javax.swing.event.HyperlinkListener;
3 import javax.swing.event.HyperlinkEvent;
4 import javax.swing.text.Document;
5 import java.net.URL;
7 class TextLogger
8 extends JEditorPane
10 public TextLogger ()
11 throws java.io.IOException
13 // maDocument = getEditorKit().createDefaultDocument();
14 super ("http://localhost");
15 try
17 // setPage (new URL ("http://www.spiegel.de"));
19 catch (Exception e)
22 setEditable (false);
23 final JEditorPane finalPane = this;
24 addHyperlinkListener (new HyperlinkListener()
26 public void hyperlinkUpdate (HyperlinkEvent e)
28 try
30 if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
31 finalPane.setPage (e.getURL());
33 catch (java.io.IOException ex)
35 ex.printStackTrace(System.err);
38 });
41 public void appendText (String sText)
43 try
45 maDocument.insertString (maDocument.getLength(), sText, null);
47 catch (javax.swing.text.BadLocationException e)
51 private Document maDocument;