List of usage examples for javax.swing.text.html HTMLDocument getElement
public Element getElement(String id)
Attribute
. From source file:org.languagetool.gui.ResultAreaHelper.java
private void setHeader(String txt) { HTMLDocument d = (HTMLDocument) statusPane.getDocument(); Element e = d.getElement(HEADER); try {// w w w . j a v a 2 s . com d.setInnerHTML(e, "<p class=\"grayed\">" + txt + "</p>"); } catch (BadLocationException ex) { Tools.showError(ex); } catch (IOException ex) { Tools.showError(ex); } }
From source file:org.languagetool.gui.ResultAreaHelper.java
private void setMain(String html) { HTMLDocument d = (HTMLDocument) statusPane.getDocument(); Element e = d.getElement(MAIN); try {//from w w w . j a v a 2s. c o m d.setInnerHTML(e, html); } catch (BadLocationException ex) { Tools.showError(ex); } catch (IOException ex) { Tools.showError(ex); } }
From source file:org.languagetool.gui.ResultAreaHelper.java
private void appendMain(String html) { HTMLDocument d = (HTMLDocument) statusPane.getDocument(); Element e = d.getElement(MAIN); try {/*from w w w . j a v a 2 s . com*/ d.insertBeforeEnd(e, html); } catch (BadLocationException ex) { Tools.showError(ex); } catch (IOException ex) { Tools.showError(ex); } }