Package javax.swing.text

Examples of javax.swing.text.StyledDocument.addStyle()


        stats.setBackground(getBackground());

        // Add styles to use for different types of status messages       
        StyledDocument doc = (StyledDocument) stats.getDocument();

        Style style = doc.addStyle("Redirect", null);
        StyleConstants.setForeground(style, REDIRECT_COLOR);

        style = doc.addStyle("ClientError", null);
        StyleConstants.setForeground(style, CLIENT_ERROR_COLOR);
View Full Code Here


        StyledDocument doc = (StyledDocument) stats.getDocument();

        Style style = doc.addStyle("Redirect", null);
        StyleConstants.setForeground(style, REDIRECT_COLOR);

        style = doc.addStyle("ClientError", null);
        StyleConstants.setForeground(style, CLIENT_ERROR_COLOR);

        style = doc.addStyle("ServerError", null);
        StyleConstants.setForeground(style, SERVER_ERROR_COLOR);
View Full Code Here

        StyleConstants.setForeground(style, REDIRECT_COLOR);

        style = doc.addStyle("ClientError", null);
        StyleConstants.setForeground(style, CLIENT_ERROR_COLOR);

        style = doc.addStyle("ServerError", null);
        StyleConstants.setForeground(style, SERVER_ERROR_COLOR);

        JScrollPane pane = makeScrollPane(stats);
        pane.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
        return pane;
View Full Code Here

        stats.setBackground(getBackground());

        // Add styles to use for different types of status messages       
        StyledDocument doc = (StyledDocument) stats.getDocument();

        Style style = doc.addStyle("Redirect", null);
        StyleConstants.setForeground(style, REDIRECT_COLOR);

        style = doc.addStyle("ClientError", null);
        StyleConstants.setForeground(style, CLIENT_ERROR_COLOR);
View Full Code Here

        StyledDocument doc = (StyledDocument) stats.getDocument();

        Style style = doc.addStyle("Redirect", null);
        StyleConstants.setForeground(style, REDIRECT_COLOR);

        style = doc.addStyle("ClientError", null);
        StyleConstants.setForeground(style, CLIENT_ERROR_COLOR);

        style = doc.addStyle("ServerError", null);
        StyleConstants.setForeground(style, SERVER_ERROR_COLOR);
View Full Code Here

        StyleConstants.setForeground(style, REDIRECT_COLOR);

        style = doc.addStyle("ClientError", null);
        StyleConstants.setForeground(style, CLIENT_ERROR_COLOR);

        style = doc.addStyle("ServerError", null);
        StyleConstants.setForeground(style, SERVER_ERROR_COLOR);

        JScrollPane pane = makeScrollPane(stats);
        pane.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
        return pane;
View Full Code Here

                    Style style = sd.getStyle(StyleContext.DEFAULT_STYLE);
                    StyleConstants.setFontFamily(style, "SansSerif");
                   
                    attrNormal = style;
                   
                    attrAddedLocally = sd.addStyle(STYLE_ADDED_LOCALLY, attrNormal);
                    StyleConstants.setForeground(attrAddedLocally, Color.BLUE);
                    StyleConstants.setBold(attrAddedLocally, true);
                   
                    attrAddedByOther = sd.addStyle(STYLE_ADDED_BY_OTHER, attrNormal);
                    StyleConstants.setForeground(attrAddedByOther, Color.RED);
View Full Code Here

                   
                    attrAddedLocally = sd.addStyle(STYLE_ADDED_LOCALLY, attrNormal);
                    StyleConstants.setForeground(attrAddedLocally, Color.BLUE);
                    StyleConstants.setBold(attrAddedLocally, true);
                   
                    attrAddedByOther = sd.addStyle(STYLE_ADDED_BY_OTHER, attrNormal);
                    StyleConstants.setForeground(attrAddedByOther, Color.RED);
                    StyleConstants.setBold(attrAddedByOther, true);
                   
                    attrRemovedByOther = sd.addStyle(STYLE_REMOVED_BY_OTHER, attrNormal);
                    StyleConstants.setForeground(attrRemovedByOther, Color.RED);
View Full Code Here

                   
                    attrAddedByOther = sd.addStyle(STYLE_ADDED_BY_OTHER, attrNormal);
                    StyleConstants.setForeground(attrAddedByOther, Color.RED);
                    StyleConstants.setBold(attrAddedByOther, true);
                   
                    attrRemovedByOther = sd.addStyle(STYLE_REMOVED_BY_OTHER, attrNormal);
                    StyleConstants.setForeground(attrRemovedByOther, Color.RED);
                    StyleConstants.setStrikeThrough(attrRemovedByOther, true);
                    StyleConstants.setBold(attrRemovedByOther, true);
                   
                    attrRemovedLocally = sd.addStyle(STYLE_REMOVED_LOCALLY, attrNormal);
View Full Code Here

                    attrRemovedByOther = sd.addStyle(STYLE_REMOVED_BY_OTHER, attrNormal);
                    StyleConstants.setForeground(attrRemovedByOther, Color.RED);
                    StyleConstants.setStrikeThrough(attrRemovedByOther, true);
                    StyleConstants.setBold(attrRemovedByOther, true);
                   
                    attrRemovedLocally = sd.addStyle(STYLE_REMOVED_LOCALLY, attrNormal);
                    StyleConstants.setForeground(attrRemovedLocally, Color.BLUE);
                    StyleConstants.setStrikeThrough(attrRemovedLocally, true);
                    StyleConstants.setBold(attrRemovedLocally, true);
                }
            }
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.