Java Code Examples for javax.swing.text.html.HTMLDocument#getBase()

The following examples show how to use javax.swing.text.html.HTMLDocument#getBase() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BrowserDisplayer.java    From netbeans with Apache License 2.0 7 votes vote down vote up
/**
    * Sets data optained from the View
    */
   public void setViewData(View v) {
myView = v;
doc = (HTMLDocument) myView.getDocument();
base = doc.getBase();

// Set the current font information in the local text attributes
Font font = getFont();
textAttribs = new SimpleAttributeSet();
textAttribs.removeAttribute(StyleConstants.FontSize);
textAttribs.removeAttribute(StyleConstants.Bold);
textAttribs.removeAttribute(StyleConstants.Italic);
textAttribs.addAttribute(StyleConstants.FontFamily,
			 font.getName());
textAttribs.addAttribute(StyleConstants.FontSize,
			 new Integer(font.getSize()));
textAttribs.addAttribute(StyleConstants.Bold,
			 Boolean.valueOf(font.isBold()));
textAttribs.addAttribute(StyleConstants.Italic,
			 Boolean.valueOf(font.isItalic()));
   }