??xml version="1.0" encoding="utf-8" standalone="yes"?>日本一区二区三区久久久久久久久不,佐山爱痴汉视频一区二区三区,在线播放av更多http://www.aygfsteel.com/lyj/archive/2008/01/21/176253.htmlM睡不?/dc:creator>M睡不?/author>Mon, 21 Jan 2008 01:41:00 GMThttp://www.aygfsteel.com/lyj/archive/2008/01/21/176253.htmlhttp://www.aygfsteel.com/lyj/comments/176253.htmlhttp://www.aygfsteel.com/lyj/archive/2008/01/21/176253.html#Feedback0http://www.aygfsteel.com/lyj/comments/commentRss/176253.htmlhttp://www.aygfsteel.com/lyj/services/trackbacks/176253.html
javax.accessibility 定义?jin)用L(fng)面组件与提供对这些组件进行访问的辅助技术之间的协定?/td>
javax.swing 提供一l?#8220;轻量U?#8221;Q全部是 Java 语言Q组Ӟ量让这些组件在所有^C的工作方式都相同?/td>
javax.swing.border 提供围绕 Swing lgl制Ҏ(gu)Ҏ(gu)的类和接口?/td>
javax.swing.colorchooser 包含?JColorChooser lg使用的类和接口?/td>
javax.swing.event ?Swing lg触发的事件用?/td>
javax.swing.filechooser 包含 JFileChooser lg使用的类和接口?/td>
javax.swing.plaf 提供一个接口和许多抽象c,Swing 用它们来提供自己的可插入外观功能?/td>
javax.swing.plaf.basic 提供?jin)根据基本外观构建的用户界面对象?/td>
javax.swing.plaf.metal 提供Ҏ(gu) Java 外观Q曾lUCؓ(f) MetalQ构建的用户界面对象QSwing 的默认外观?/td>
javax.swing.plaf.multi 提供?jin)组合两个或多个外观的用L(fng)面对象?/td>
javax.swing.plaf.synth Synth 是一个可更换皮肤 (skinnable) 的外观,在其中可委托所有绘制?/td>
javax.swing.table 提供用于处理 javax.swing.JTable 的类和接口?/td>
javax.swing.text 提供c?DefaultEditorKit 和创建文本编辑器的支持类?/td>
javax.swing.text.html 提供c?HTMLEditorKit 和创?HTML 文本~辑器的支持cR?/td>
javax.swing.text.html.parser 提供默认?HTML 解析器以?qing)支持类?/td>
javax.swing.text.rtf 提供一个类 (RTFEditorKit)Q用于创建富文本格式QRich-Text-FormatQ的文本~辑器?/td>
javax.swing.tree 提供处理 javax.swing.JTree 的类和接口?/td>
javax.swing.undo 为应用程序(例如文本~辑器)(j)中的撤消/恢复提供支持?/td>

其中好多都不常用Q最常用是q两个:(x)

  • javax.swing
  • javax.swing.event
下面看两个例子,作ؓ(f)~程时的参考?br /> 例程1.1 HelloWorldSwing.java
/*
 * HelloWorldSwing.java 不需要其他文?br />  
*/

import javax.swing.*;

public class HelloWorldSwing {
    
/**
     * 创徏GUIq显C?br />      * Z(jin)U程安全Q这个方法应该在事g调度U程中调用?br />      
*/

    
public static void createAndShowGUI() {
        
// 创徏H口Qƈ讄关闭H口后退出程?/span>
        JFrame frame = new JFrame("HelloWorldSwing");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        
// d一个label, label在SwingE序中随处可?/span>
        JLabel label = new JLabel("Hello World");
        frame.getContentPane().add(label);

        
// 自动调整大小q显C窗?/span>
        frame.pack();
        frame.setVisible(
true);
    }

    
public static void main(String[] args) {
        
// 让事件调度线E调用createAndShowGUI() 
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            
public void run() {
                createAndShowGUI();
            }

        }
);
    }

}


例程2.2 HelloWorldJFrame.java
/*
 * q是一个HelloWorldSwing的JFrame版本
 * 不需要其他文件的支持
 
*/

import javax.swing.*;
import java.awt.event.*;

public class HelloWorldJFrame extends JFrame {
    
/**
     * 在构造方法中初始化组?br />      
*/

    
public HelloWorldJFrame() {
        
// 讄标题
        setTitle("HelloWorldJFrame");

        
// dlabel
        JLabel label = new JLabel();
        label.setText(
"Hello World");
        getContentPane().add(label);
    }


    
public static void main(String[] args) {

        
// 创徏H体q设|关闭窗口时退出程?br />         // 在HelloWorldSwing中用?br />         //     setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
        
// q里换了(jin)一U方?/span>
        HelloWorldJFrame frame = new HelloWorldJFrame();
        WindowListener l 
= new WindowAdapter() {
                
public void windowClosing(WindowEvent e) {
                    System.exit(
0);
                }

        }
;
        frame.addWindowListener(l);

        
// 昄H体
        frame.pack();
        frame.setVisible(
true);
    }

}



]]>
提问Q用枚丄cMZ?x)出C个匿名类Q?/title><link>http://www.aygfsteel.com/lyj/archive/2007/08/07/135032.html</link><dc:creator>M睡不?/dc:creator><author>M睡不?/author><pubDate>Tue, 07 Aug 2007 11:03:00 GMT</pubDate><guid>http://www.aygfsteel.com/lyj/archive/2007/08/07/135032.html</guid><wfw:comment>http://www.aygfsteel.com/lyj/comments/135032.html</wfw:comment><comments>http://www.aygfsteel.com/lyj/archive/2007/08/07/135032.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.aygfsteel.com/lyj/comments/commentRss/135032.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/lyj/services/trackbacks/135032.html</trackback:ping><description><![CDATA[先看一下代码:(x)<br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080"> 1</span> <span style="COLOR: #0000ff">enum</span><span style="COLOR: #000000"> MyColor { red, green, blue}<br></span><span style="COLOR: #008080"> 2</span> <span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 3</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> TestEnum {<br></span><span style="COLOR: #008080"> 4</span> <span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 5</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> main(String[] args) {<br></span><span style="COLOR: #008080"> 6</span> <span style="COLOR: #000000">        MyColor m </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> MyColor.blue;<br></span><span style="COLOR: #008080"> 7</span> <span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 8</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">switch</span><span style="COLOR: #000000">(m) {<br></span><span style="COLOR: #008080"> 9</span> <span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">case</span><span style="COLOR: #000000"> red:<br></span><span style="COLOR: #008080">10</span> <span style="COLOR: #000000">                System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">red</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">11</span> <span style="COLOR: #000000">                </span><span style="COLOR: #0000ff">break</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">12</span> <span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">case</span><span style="COLOR: #000000"> green:<br></span><span style="COLOR: #008080">13</span> <span style="COLOR: #000000">                System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">green</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">14</span> <span style="COLOR: #000000">                </span><span style="COLOR: #0000ff">break</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">15</span> <span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">case</span><span style="COLOR: #000000"> blue:<br></span><span style="COLOR: #008080">16</span> <span style="COLOR: #000000">                System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">blue</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">17</span> <span style="COLOR: #000000">                </span><span style="COLOR: #0000ff">break</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">18</span> <span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">default</span><span style="COLOR: #000000">:<br></span><span style="COLOR: #008080">19</span> <span style="COLOR: #000000">                System.out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">default</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">20</span> <span style="COLOR: #000000">                </span><span style="COLOR: #0000ff">break</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">21</span> <span style="COLOR: #000000">        }<br></span><span style="COLOR: #008080">22</span> <span style="COLOR: #000000"><br></span><span style="COLOR: #008080">23</span> <span style="COLOR: #000000">        System.out.println(m);<br></span><span style="COLOR: #008080">24</span> <span style="COLOR: #000000">    }<br></span><span style="COLOR: #008080">25</span> <span style="COLOR: #000000">}<br></span><span style="COLOR: #008080">26</span> <span style="COLOR: #000000"></span></div> <br>TestEnumcȝ译后Q会(x)产生三个class文gQMyColor.class、TestEnum$1.class、TestEnum.class?br><br>枚Dq当于一个类Q所以会(x)有MyColor.class。问题是Qؓ(f)什么会(x)出现TestEnum$1.classq个匿名cR难道是枚DcM使用的red, green, blue三个值造成的?br><br>那位大侠知道Q给弟解释一下,先谢谢了(jin)Q?img height=20 src="http://www.aygfsteel.com/Emoticons/QQ/15.gif" width=20 border=0> <img src ="http://www.aygfsteel.com/lyj/aggbug/135032.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/lyj/" target="_blank">M睡不?/a> 2007-08-07 19:03 <a href="http://www.aygfsteel.com/lyj/archive/2007/08/07/135032.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ԭ</a>| <a href="http://" target="_blank">۩</a>| <a href="http://" target="_blank">ӽ</a>| <a href="http://" target="_blank">ԫ</a>| <a href="http://" target="_blank">¡</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ԫ</a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ֵ</a>| <a href="http://" target="_blank">ƫ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʻ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">΢</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">˴</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ҧ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>