Package javax.swing.text.html

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


        initComponents();
        HTMLEditorKit hed = new HTMLEditorKit();
        StyleSheet sheet = hed.getStyleSheet();

        sheet.addRule(".php-boundry {font-weight:bold;}");
        sheet.addRule(".php-function-or-constant {color:#0000AA; }");
        sheet.addRule(".php-string {color:#AA0000; }");
        sheet.addRule(".php-constant {color:#AA3333; }");
        sheet.addRule(".php-variable {color:#333300; }");
        sheet.addRule(".php-keyword {color:#006600; }");
        sheet.addRule("pre {background-color: #F6F6F2; white-space:pre-wrap;}");
View Full Code Here


        HTMLEditorKit hed = new HTMLEditorKit();
        StyleSheet sheet = hed.getStyleSheet();

        sheet.addRule(".php-boundry {font-weight:bold;}");
        sheet.addRule(".php-function-or-constant {color:#0000AA; }");
        sheet.addRule(".php-string {color:#AA0000; }");
        sheet.addRule(".php-constant {color:#AA3333; }");
        sheet.addRule(".php-variable {color:#333300; }");
        sheet.addRule(".php-keyword {color:#006600; }");
        sheet.addRule("pre {background-color: #F6F6F2; white-space:pre-wrap;}");
        sheet.addRule(".code {background-color: #F6F6F2; white-space:pre-wrap;margin-bottom:5px;margin-top:5px;}");
View Full Code Here

        sheet.addRule(".php-boundry {font-weight:bold;}");
        sheet.addRule(".php-function-or-constant {color:#0000AA; }");
        sheet.addRule(".php-string {color:#AA0000; }");
        sheet.addRule(".php-constant {color:#AA3333; }");
        sheet.addRule(".php-variable {color:#333300; }");
        sheet.addRule(".php-keyword {color:#006600; }");
        sheet.addRule("pre {background-color: #F6F6F2; white-space:pre-wrap;}");
        sheet.addRule(".code {background-color: #F6F6F2; white-space:pre-wrap;margin-bottom:5px;margin-top:5px;}");
        sheet.addRule(".code p{margin-left:5px}");
        Document doc = hed.createDefaultDocument();
View Full Code Here

        sheet.addRule(".php-boundry {font-weight:bold;}");
        sheet.addRule(".php-function-or-constant {color:#0000AA; }");
        sheet.addRule(".php-string {color:#AA0000; }");
        sheet.addRule(".php-constant {color:#AA3333; }");
        sheet.addRule(".php-variable {color:#333300; }");
        sheet.addRule(".php-keyword {color:#006600; }");
        sheet.addRule("pre {background-color: #F6F6F2; white-space:pre-wrap;}");
        sheet.addRule(".code {background-color: #F6F6F2; white-space:pre-wrap;margin-bottom:5px;margin-top:5px;}");
        sheet.addRule(".code p{margin-left:5px}");
        Document doc = hed.createDefaultDocument();
        txtHelp.setEditorKit(hed);
View Full Code Here

        sheet.addRule(".php-function-or-constant {color:#0000AA; }");
        sheet.addRule(".php-string {color:#AA0000; }");
        sheet.addRule(".php-constant {color:#AA3333; }");
        sheet.addRule(".php-variable {color:#333300; }");
        sheet.addRule(".php-keyword {color:#006600; }");
        sheet.addRule("pre {background-color: #F6F6F2; white-space:pre-wrap;}");
        sheet.addRule(".code {background-color: #F6F6F2; white-space:pre-wrap;margin-bottom:5px;margin-top:5px;}");
        sheet.addRule(".code p{margin-left:5px}");
        Document doc = hed.createDefaultDocument();
        txtHelp.setEditorKit(hed);
        tree.setModel(treeModel);
View Full Code Here

        sheet.addRule(".php-string {color:#AA0000; }");
        sheet.addRule(".php-constant {color:#AA3333; }");
        sheet.addRule(".php-variable {color:#333300; }");
        sheet.addRule(".php-keyword {color:#006600; }");
        sheet.addRule("pre {background-color: #F6F6F2; white-space:pre-wrap;}");
        sheet.addRule(".code {background-color: #F6F6F2; white-space:pre-wrap;margin-bottom:5px;margin-top:5px;}");
        sheet.addRule(".code p{margin-left:5px}");
        Document doc = hed.createDefaultDocument();
        txtHelp.setEditorKit(hed);
        tree.setModel(treeModel);
        tree.setModel(treeModel);
View Full Code Here

        sheet.addRule(".php-constant {color:#AA3333; }");
        sheet.addRule(".php-variable {color:#333300; }");
        sheet.addRule(".php-keyword {color:#006600; }");
        sheet.addRule("pre {background-color: #F6F6F2; white-space:pre-wrap;}");
        sheet.addRule(".code {background-color: #F6F6F2; white-space:pre-wrap;margin-bottom:5px;margin-top:5px;}");
        sheet.addRule(".code p{margin-left:5px}");
        Document doc = hed.createDefaultDocument();
        txtHelp.setEditorKit(hed);
        tree.setModel(treeModel);
        tree.setModel(treeModel);
        tree.setCellRenderer(new TreeRenderer());
View Full Code Here

           
            HTMLEditorKit kit = new HTMLEditorKit();
            adPane.setEditorKit(kit);
           
            StyleSheet styleSheet = kit.getStyleSheet();
            styleSheet.addRule("body { width: 160px; margin: 0; padding: 10px 0 0 0; }");
            //styleSheet.addRule("div { width: 160px; height:600px; position:absolute; top:50%; margin-top:-300px; }");
            String result = "<html><body><div><a href=\"" + ad.getUrl() + "\"><img src=\"" + ad.getImage() + "\" alt=\"" + ad.getTitle() + "\" border=\"0\"/></a></div></body></html>";
            Document doc = kit.createDefaultDocument();
            adPane.setDocument(doc);
            adPane.setText(result);
View Full Code Here

   
    Font font = UIManager.getFont("Label.font");
        String bodyRule = "body { font-family: "+font.getFamily()+"; "+
                "font-size: " + font.getSize() + "pt; }";
        StyleSheet styles=((HTMLDocument)p.getDocument()).getStyleSheet();
        styles.addRule(bodyRule);
        return p;
  }
}
View Full Code Here

        setEditorKit(new HTMLEditorKit());
        Font font = UIManager.getFont("Label.font");
        StyleSheet css = ((HTMLDocument)getDocument()).getStyleSheet();
        setOpaque(false);

        css.addRule("body {color : #" + getHexValue(UIManager.getColor("Label.foreground")) + " }");
        css.addRule("body {font-size : " + font.getSize() + "pt; }");
        css.addRule("body {font-family :" + font.getFontName() + "; }");
        setInverted(false);

        if (text != null) {
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.