亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? style_modstyle.html

?? java類(lèi)庫(kù)詳細(xì)講解
?? HTML
字號(hào):
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>Automatically Updating Styled Text When a Style Is Updated
(Java Developers Almanac Example)
</TITLE>
<META CONTENT="Patrick Chan" NAME="AUTHOR">
<META CONTENT="Code Examples from The Java Developers Almanac 1.4" NAME="DESCRIPTION">
<META CONTENT="Addison-Wesley/Patrick Chan" NAME="OWNER">
<META CONTENT="3/20/02" NAME="revision">
<STYLE TYPE="text/css">
<!--     BODY CODE  {font-family: Courier, Monospace;           font-size: 11pt}    TABLE, BODY          {font-family: Verdana, Arial, Helvetica, sans-serif;           font-size: 10pt}    PRE   {font-family: Courier, Monospace;           font-size: 10pt}    H3    {font-family: Verdana, Arial, Helvetica, sans-serif;           font-size: 11pt}    A.eglink {text-decoration: none}    A:hover.eglink {text-decoration: underline}    -->
</STYLE>
</HEAD>
<BODY>
<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0">
<TR>
<TD rowspan="3"><A HREF="/?l=ex"><IMG BORDER="0" ALIGN="BOTTOM" HSPACE="10" SRC="/egs/almanac14a.jpg"></A></TD><TD VALIGN="top"><font face="Times" size="6"><b>The Java Developers Almanac 1.4</b></font>
<br>
        Order this book from <a href="/cgi-bin/scripts/redirect.pl?l=ex&url=http://www.amazon.com/exec/obidos/ASIN/0201752808/xeo">Amazon</a>.
    </TD>
</TR>
<TR>
<TD align="right" valign="bottom">
<FORM method="get" action="/cgi-bin/search/find.pl">
<INPUT size="25" name="words" type="text"><INPUT value="Search" type="submit">
</FORM>
</TD>
</TR>
</TABLE>
<HR color="#6666cc">
<DIV ALIGN="LEFT">
<A HREF="/">Home</A>
    &gt;
    <A HREF="../index.html">List of Packages</A>
    &gt;
    <B><A HREF="../javax.swing.text/pkg.html">javax.swing.text</A></B><font color="#666666" SIZE="-2">
        &nbsp;[49 examples]
        </font>
        &gt;
        <B><A HREF="../javax.swing.text/pkg.html#Styles">Styles</A></B><font color="#666666" SIZE="-2">
            &nbsp;[9 examples]
            </font>
</DIV><P>
  <h3>
    e1012.  
    Automatically Updating Styled Text When a Style Is Updated</h3>

When a style is applied to text in a text pane, the text is set with
the attributes of the style.  If the style is changed, the set of
attributes associated with the range of text does not change.

<P> This example demonstrates how to have styled text automatically
updated when the style object used to style the text is changed.  When
a named style is applied to text, the name of the style is included in
the set of attributes that are associated with the text.  Hence it is
possible to find all the places where a named style has been applied
in a text pane. The <code>reapplyStyle()</code> method takes a style object
and searches the text pane for all uses the style (by name) and
reapplies the style.

<P> In order to detect changes to a style, a change listener is
added to the style.  Whenever the style is changed, the style's change
listener will call <code>reapplyStyle()</code> to update the text pane.


<pre>
    final JTextPane textPane = new JTextPane();
    ChangeListener changeListener = new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            reapplyStyles(textPane, (Style)e.getSource());
        }
    };
    
    // Make paragraph red
    Style style = textPane.addStyle("Highlight", null);
    style.addChangeListener(changeListener);
    StyleConstants.setForeground(style, <font color="#0066ff"><i>Color.red</i></font>);
    textPane.setParagraphAttributes(style, true);
    // paragraph appears red
    
    style = textPane.getStyle("Highlight");
    StyleConstants.setUnderline(style, <font color="#0066ff"><i>true</i></font>);
    // paragraph becomes red and underlined
    
    // This method traverses every paragraph and content element
    // and reapplies any style that matches the specified style
    public static void reapplyStyles(JTextPane c, Style style) {
        // Get section element
        Element sectionElem = c.getDocument().getDefaultRootElement();
    
        // Get number of paragraphs.
        int paraCount = sectionElem.getElementCount();
    
        for (int i=0; i&lt;paraCount; i++) {
            Element paraElem = sectionElem.getElement(i);
            AttributeSet attr = paraElem.getAttributes();
    
            // Get the name of the style applied to this paragraph element; may be null
            String sn = (String)attr.getAttribute(StyleConstants.NameAttribute);
    
            // Check if style name match
            if (style.getName().equals(sn)) {
                // Reapply the paragraph style
                int rangeStart = paraElem.getStartOffset();
                int rangeEnd = paraElem.getEndOffset();
                c.getStyledDocument().setParagraphAttributes(
                    rangeStart, rangeEnd-rangeStart, style, true);
            }
    
            // Enumerate the content elements
            for (int j=0; j&lt;paraElem.getElementCount(); j++) {
                Element contentElem = paraElem.getElement(j);
                attr = contentElem.getAttributes();
    
                // Get the name of the style applied to this content element; may be null
                sn = (String)attr.getAttribute(StyleConstants.NameAttribute);
    
                // Check if style name match
                if (style.getName().equals(sn)) {
                    // Reapply the content style
                    int rangeStart = contentElem.getStartOffset();
                    int rangeEnd = contentElem.getEndOffset();
                    c.getStyledDocument().setCharacterAttributes(
                        rangeStart, rangeEnd-rangeStart, style, true);
                }
            }
        }
    }
</pre>
<P><table width="600" CELLSPACING="0" CELLPADDING="2" BORDER="0">
<tr>
<td bgcolor="#6666cc" align="center"><font color="#ffffff">
            &nbsp;Related Examples
        </font></td>
</tr>
</table>


e1005. <a class="eglink" href="style_HiliteWords.html?l=rel">
    Highlighting Words in a JTextComponent
</a>
<br>

e1006. <a class="eglink" href="style_HiliteWords2.html?l=rel">
    Setting the Font and Color of Text in a JTextPane Using Styles
</a>
<br>

e1007. <a class="eglink" href="style_ShareStyleContext.html?l=rel">
    Sharing Styles Between JTextPanes
</a>
<br>

e1008. <a class="eglink" href="style_ListStyles.html?l=rel">
    Listing the Styles Associated with a JTextPane
</a>
<br>

e1009. <a class="eglink" href="style_ListAttr.html?l=rel">
    Listing the Attributes in a Style
</a>
<br>

e1010. <a class="eglink" href="style_ListStyles2.html?l=rel">
    Using a Popup to Apply Styles to a JTextPane
</a>
<br>

e1011. <a class="eglink" href="style_SetPara.html?l=rel">
    Retaining the Logical Style When Setting a New Paragraph Style
</a>
<br>

e1013. <a class="eglink" href="style_IsCharPara.html?l=rel">
    Determining If a Style Attribute Applies to a Character or the Paragraph
</a>
<br>


<table width="600" CELLSPACING="0" CELLPADDING="2" BORDER="0">
<tr>
<td align="left">
<br>
        See also: 
<a class="eglink" href="/egs/javax.swing.text/pkg.html?l=rel#Actions%20and%20Key%20Bindings">
    Actions and Key Bindings
</a>&nbsp;&nbsp;

<a class="eglink" href="/egs/javax.swing.text/pkg.html?l=rel#Caret%20and%20Selection">
    Caret and Selection
</a>&nbsp;&nbsp;

<a class="eglink" href="/egs/javax.swing.text/pkg.html?l=rel#Events">
    Events
</a>&nbsp;&nbsp;

<a class="eglink" href="/egs/javax.swing.text/pkg.html?l=rel#JEditorPane">
    JEditorPane
</a>&nbsp;&nbsp;

<a class="eglink" href="/egs/javax.swing.text/pkg.html?l=rel#JFormattedTextField">
    JFormattedTextField
</a>&nbsp;&nbsp;

<a class="eglink" href="/egs/javax.swing.text/pkg.html?l=rel#JTextArea">
    JTextArea
</a>&nbsp;&nbsp;

<a class="eglink" href="/egs/javax.swing.text/pkg.html?l=rel#JTextComponent">
    JTextComponent
</a>&nbsp;&nbsp;

<a class="eglink" href="/egs/javax.swing.text/pkg.html?l=rel#JTextField">
    JTextField
</a>&nbsp;&nbsp;

<a class="eglink" href="/egs/javax.swing.text/pkg.html?l=rel#JTextPane">
    JTextPane
</a>&nbsp;&nbsp;

</td>
</tr>
</table>

<br>

<br>
<FONT FACE="Verdana, Arial, Helvetica, sans-serif" SIZE="0">
&copy; 2002 Addison-Wesley.
</FONT>
</BODY>
</HTML>

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃视频免费观看一区| 国产一区二区三区久久久| 久久久久久久综合色一本| 色综合久久综合| 极品尤物av久久免费看| 亚洲综合在线免费观看| 国产婷婷色一区二区三区| 欧美日韩国产免费| 色呦呦国产精品| 国产精品456露脸| 日韩制服丝袜先锋影音| 亚洲精品综合在线| 国产精品日日摸夜夜摸av| 亚洲精品在线电影| 7777女厕盗摄久久久| 欧洲生活片亚洲生活在线观看| 国产高清不卡一区| 美国一区二区三区在线播放| 一区二区三区欧美久久| 国产精品成人免费| 国产精品丝袜一区| 国产欧美日产一区| 国产亚洲精品精华液| 欧美成人精品福利| 欧美不卡一区二区三区| 91精品在线观看入口| 欧美日韩精品欧美日韩精品一综合| 色偷偷一区二区三区| 99re这里只有精品首页| 风间由美一区二区av101| 国产激情一区二区三区| 韩国欧美国产1区| 国产麻豆精品在线观看| 激情五月播播久久久精品| 久久激情五月婷婷| 久久爱另类一区二区小说| 久久精品国产999大香线蕉| 久久er99热精品一区二区| 老色鬼精品视频在线观看播放| 日本在线不卡视频| 麻豆国产一区二区| 国产一区在线视频| 成人av免费观看| 91美女蜜桃在线| 欧美在线啊v一区| 欧美一区在线视频| 日韩三区在线观看| 国产亚洲综合在线| 中文字幕成人av| 一色桃子久久精品亚洲| 亚洲欧美电影院| 亚洲一区二区三区爽爽爽爽爽| 五月天亚洲精品| 蜜桃视频免费观看一区| 国产成人精品三级| 91丨九色porny丨蝌蚪| 欧美日韩成人在线一区| 精品国产髙清在线看国产毛片| 2023国产一二三区日本精品2022| 国产亚洲va综合人人澡精品| 综合色中文字幕| 亚洲成av人片| 国内精品在线播放| 色诱视频网站一区| 日韩欧美电影一区| 中文字幕av不卡| 亚洲成人一区在线| 精品在线一区二区| www.欧美日韩| 制服丝袜亚洲播放| 国产日韩欧美精品一区| 亚洲一区影音先锋| 久草精品在线观看| 91玉足脚交白嫩脚丫在线播放| 欧美日韩久久久| 欧美激情综合网| 五月综合激情婷婷六月色窝| 国产大陆a不卡| 欧美三级电影精品| 亚洲午夜久久久久久久久久久| 久久国产精品露脸对白| 一本大道av一区二区在线播放| 日韩视频在线永久播放| 综合欧美一区二区三区| 蜜桃精品视频在线| 在线观看国产一区二区| 26uuu国产一区二区三区| 亚洲一区二区3| 成人午夜激情在线| 欧美一区二区日韩| 亚洲精品日韩一| 国产精品一区二区三区99| 欧美午夜视频网站| 亚洲国产精品成人综合色在线婷婷| 午夜欧美大尺度福利影院在线看| 国产福利一区二区三区视频| 在线不卡一区二区| 亚洲视频一区二区免费在线观看| 美国欧美日韩国产在线播放| 欧美探花视频资源| 国产精品女同一区二区三区| 美腿丝袜亚洲综合| 欧美综合视频在线观看| 中文字幕在线不卡| 国产一区 二区| 欧美大肚乱孕交hd孕妇| 亚洲综合另类小说| av亚洲精华国产精华精华 | 日韩精品资源二区在线| 一区二区三区国产精品| 不卡视频一二三| 久久久精品欧美丰满| 美女mm1313爽爽久久久蜜臀| 欧美肥妇毛茸茸| 亚洲永久精品大片| 91首页免费视频| 国产精品久久久久久福利一牛影视| 另类综合日韩欧美亚洲| 91精品国产欧美日韩| 亚洲国产视频一区| 欧美优质美女网站| 亚洲美女淫视频| 一道本成人在线| 中文字幕一区视频| 成人免费高清视频| 国产精品久久久久久久久果冻传媒 | 国产精品不卡在线| 成人精品视频一区二区三区| 国产亚洲成年网址在线观看| 国产麻豆午夜三级精品| 国产亚洲欧美在线| 国产成人免费在线视频| 国产欧美综合在线| 成人综合在线观看| 中文字幕一区二区三| 91麻豆免费观看| 亚洲永久精品国产| 欧美日韩国产成人在线免费| 午夜不卡av免费| 欧美一卡2卡三卡4卡5免费| 麻豆极品一区二区三区| wwwwxxxxx欧美| 国产99久久久精品| 亚洲人成网站影音先锋播放| 在线精品亚洲一区二区不卡| 亚洲综合丝袜美腿| 欧美一区二区精品久久911| 欧美熟乱第一页| 亚洲成人第一页| 欧美tk丨vk视频| 成人永久免费视频| 亚洲免费三区一区二区| 欧美日韩高清影院| 精品中文字幕一区二区| 中文字幕第一页久久| 色成年激情久久综合| 视频一区二区不卡| 久久精品一区二区| 色哟哟欧美精品| 日本成人在线电影网| 久久嫩草精品久久久精品| 北条麻妃国产九九精品视频| 亚洲一区视频在线观看视频| 欧美成人一区二区三区| 成人sese在线| 婷婷成人综合网| 久久久91精品国产一区二区三区| 成人免费视频一区二区| 亚洲国产中文字幕在线视频综合| 日韩欧美在线影院| 成人18视频在线播放| 天天做天天摸天天爽国产一区| 精品国产免费人成电影在线观看四季 | 91网站最新网址| 日本一区中文字幕| 国产欧美一区二区精品性色超碰| 一本大道久久a久久精二百| 蓝色福利精品导航| 亚洲精品免费视频| 久久在线观看免费| 欧美视频自拍偷拍| 成人免费av在线| 免费欧美在线视频| 亚洲欧美色综合| 国产日韩视频一区二区三区| 欧美日韩精品三区| 波多野洁衣一区| 久久成人免费电影| 亚洲国产精品一区二区久久| 国产亚洲欧洲一区高清在线观看| 欧美日韩中字一区| 成人免费不卡视频| 国产在线不卡一区| 日本人妖一区二区| 亚洲视频免费看| 久久精品无码一区二区三区| 欧美日韩精品免费| 色综合中文字幕国产 | 久久久99免费| 制服丝袜在线91|