Package javax.swing.text.html

Examples of javax.swing.text.html.StyleSheet.addRule()


    private void setStyleSheets() {
        StyleSheet styleSheet = new StyleSheet();
        styleSheet.addRule("body {font-size: " + Driver.getFontSize() + "pt}");
        styleSheet.addRule("H1 {color: red;  font-size: 120%; font-weight: bold;}");
        styleSheet.addRule("code {font-family: courier; font-size: " + Driver.getFontSize() + "pt}");
        styleSheet.addRule(" a:link { color: #0000FF; } ");
        styleSheet.addRule(" a:visited { color: #800080; } ");
        styleSheet.addRule(" a:active { color: #FF0000; text-decoration: underline; } ");
        HTMLEditorKit htmlEditorKit = new HTMLEditorKit();
        htmlEditorKit.setStyleSheet(styleSheet);
        mainFrame.summaryHtmlArea.setEditorKit(htmlEditorKit);
View Full Code Here


        StyleSheet styleSheet = new StyleSheet();
        styleSheet.addRule("body {font-size: " + Driver.getFontSize() + "pt}");
        styleSheet.addRule("H1 {color: red;  font-size: 120%; font-weight: bold;}");
        styleSheet.addRule("code {font-family: courier; font-size: " + Driver.getFontSize() + "pt}");
        styleSheet.addRule(" a:link { color: #0000FF; } ");
        styleSheet.addRule(" a:visited { color: #800080; } ");
        styleSheet.addRule(" a:active { color: #FF0000; text-decoration: underline; } ");
        HTMLEditorKit htmlEditorKit = new HTMLEditorKit();
        htmlEditorKit.setStyleSheet(styleSheet);
        mainFrame.summaryHtmlArea.setEditorKit(htmlEditorKit);
    }
View Full Code Here

        styleSheet.addRule("body {font-size: " + Driver.getFontSize() + "pt}");
        styleSheet.addRule("H1 {color: red;  font-size: 120%; font-weight: bold;}");
        styleSheet.addRule("code {font-family: courier; font-size: " + Driver.getFontSize() + "pt}");
        styleSheet.addRule(" a:link { color: #0000FF; } ");
        styleSheet.addRule(" a:visited { color: #800080; } ");
        styleSheet.addRule(" a:active { color: #FF0000; text-decoration: underline; } ");
        HTMLEditorKit htmlEditorKit = new HTMLEditorKit();
        htmlEditorKit.setStyleSheet(styleSheet);
        mainFrame.summaryHtmlArea.setEditorKit(htmlEditorKit);
    }
View Full Code Here

          HTMLEditorKit kit = new HTMLEditorKit();
          pane.setEditorKit(kit);

          StyleSheet styleSheet = kit.getStyleSheet();
          styleSheet.addRule("body {font-family:\"Helvetica Neue\", Arial, Helvetica, sans-serif;}");
          styleSheet.addRule("h1 {margin:2px;padding:2px;}");
          styleSheet.addRule("p {margin:2px;padding:2px;}");

          Document doc = kit.createDefaultDocument();
          pane.setDocument(doc);
View Full Code Here

          HTMLEditorKit kit = new HTMLEditorKit();
          pane.setEditorKit(kit);

          StyleSheet styleSheet = kit.getStyleSheet();
          styleSheet.addRule("body {font-family:\"Helvetica Neue\", Arial, Helvetica, sans-serif;}");
          styleSheet.addRule("h1 {margin:2px;padding:2px;}");
          styleSheet.addRule("p {margin:2px;padding:2px;}");

          Document doc = kit.createDefaultDocument();
          pane.setDocument(doc);
          pane.setText(html);
View Full Code Here

          pane.setEditorKit(kit);

          StyleSheet styleSheet = kit.getStyleSheet();
          styleSheet.addRule("body {font-family:\"Helvetica Neue\", Arial, Helvetica, sans-serif;}");
          styleSheet.addRule("h1 {margin:2px;padding:2px;}");
          styleSheet.addRule("p {margin:2px;padding:2px;}");

          Document doc = kit.createDefaultDocument();
          pane.setDocument(doc);
          pane.setText(html);
View Full Code Here

  static public StyleSheet s_getDefault()
    {
        StyleSheet sst = new StyleSheet();

        for (int i=0; i<GfrStyleSheet._STRS_DEFAULT_RULE_.length; i++)
            sst.addRule(GfrStyleSheet._STRS_DEFAULT_RULE_[i]);

        // ending
        return sst;
    }
}
View Full Code Here

    StyleSheet styles = htmlkit.getStyleSheet();
    StyleSheet ss = new StyleSheet();

    ss.addStyleSheet(styles);

    ss.addRule("body {font-family:arial;font-size:12pt}");
    ss.addRule("p {font-family:arial;margin:2}");

    HTMLDocument doc = new HTMLDocLinkDetector(ss);

    setEditorKit(htmlkit);
View Full Code Here

    StyleSheet ss = new StyleSheet();

    ss.addStyleSheet(styles);

    ss.addRule("body {font-family:arial;font-size:12pt}");
    ss.addRule("p {font-family:arial;margin:2}");

    HTMLDocument doc = new HTMLDocLinkDetector(ss);

    setEditorKit(htmlkit);
View Full Code Here

    tip.addMouseMotionListener(linkMouseListener);
    final HTMLDocument document = (HTMLDocument) tip.getDocument();
    final StyleSheet styleSheet = document.getStyleSheet();
    styleSheet.removeStyle("p");
    styleSheet.removeStyle("body");
    styleSheet.addRule("p {margin-top:0;}\n");

    final JRestrictedSizeScrollPane scrollPane = new JRestrictedSizeScrollPane(tip);
    scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    scrollPane.setMaximumSize(new Dimension(Integer.MAX_VALUE, maximumWidth / 2));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.