(String text)
| 83 | } |
| 84 | |
| 85 | public void setText(String text) |
| 86 | { |
| 87 | //This is done so the vertical scroll bar goes back up to the top when the text is changed |
| 88 | EditorKit kit = textPane.getEditorKit(); |
| 89 | Document newDoc = kit.createDefaultDocument(); |
| 90 | try |
| 91 | { |
| 92 | kit.read(new StringReader(text), newDoc, 0); |
| 93 | } |
| 94 | catch (IOException | BadLocationException ex) |
| 95 | { |
| 96 | throw new UnreachableError(ex); |
| 97 | } |
| 98 | textPane.setDocument(newDoc); |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * Adds a hyperlink listener for notification of any changes, for example when a |
no test coverage detected