SEOIT

          SEO學習

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            6 Posts :: 1 Stories :: 2 Comments :: 0 Trackbacks

           

          這個程序了不得,基本控件全包含進去了。。。真佩服這個程序的作者

            package ch02.section02;

            import javax.swing.*;

            import java.awt.*;

            import java.awt.event.*;

            import javax.swing.tree.*;

            import javax.swing.event.*;

            import javax.swing.border.*;

            import javax.swing.table.*;

            public class SwingTest extends JFrame{

            public SwingTest(){

            MenuTest menuTest=new MenuTest();

            LeftPanel leftPanel=new LeftPanel();

            RightPanel rightPanel=new RightPanel();

            BottomPanel bottomPanel=new BottomPanel();

            CenterPanel centerPanel=new CenterPanel();

            Container c=this.getContentPane();

            this.setJMenuBar(menuTest);

            c.add(leftPanel,BorderLayout.WEST);

            c.add(rightPanel,BorderLayout.EAST);

            c.add(centerPanel,BorderLayout.CENTER);

            c.add(bottomPanel,BorderLayout.SOUTH);

            this.addWindowListener(new WindowAdapter(){

            public void WindowClosing(WindowEvent e){

            dispose();

            System.exit(0);

            }

            });

            setSize(700,500);

            setTitle("Swing 組件大全簡體版");

            setUndecorated(true);

            setLocation(200,150);

            show();

            }

            class MenuTest extends JMenuBar{

            private JDialog aboutDialog;

            public MenuTest(){

            JMenu fileMenu=new JMenu("文件");

            JMenuItem exitMenuItem=new JMenuItem("退出",KeyEvent.VK_E);

            JMenuItem aboutMenuItem=new JMenuItem("關于..",KeyEvent.VK_A);

            fileMenu.add(exitMenuItem);

            fileMenu.add(aboutMenuItem);

            this.add(fileMenu);

            aboutDialog=new JDialog();

            initAboutDialog();

            exitMenuItem.addActionListener(new ActionListener(){

            public void actionPerformed(ActionEvent e){

            dispose();

            System.exit(0);

            }

            });

            aboutMenuItem.addActionListener(new ActionListener(){

            public void actionPerformed(ActionEvent e){

            aboutDialog.show();

            }

            });

            }

          posted on 2009-12-11 23:49 文化 閱讀(4427) 評論(1)  編輯  收藏

          Feedback

          # re: java Swing組件大全超牛的例子 2014-09-23 11:56 zuidaima
          java swing demo源代碼下載:http://zuidaima.com/share_topic/kSwing%E5%92%8CAWT%E5%BC%80%E5%8F%91-p1-s1.htm  回復  更多評論
            


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          fag進口軸承 nsk進口軸承 timken進口軸承 二水氯化鈣 天津不銹鋼 天津服裝批發 天津裝修 孕婦裝批發 無水氯化鈣 氯化鈣 自動化 融雪劑 防凍液 無水氯化鈣 二水氯化鈣 安卓手機推薦 氯化鈣價格不銹鋼 不銹鋼 淘寶網女裝
          主站蜘蛛池模板: 霍城县| 普陀区| 柏乡县| 永州市| 仪征市| 祁连县| 仙游县| 庆阳市| 和顺县| 连江县| 盐边县| 合阳县| 勃利县| 红桥区| 和顺县| 张北县| 调兵山市| 长乐市| 封丘县| 荣成市| 泌阳县| 崇州市| 会同县| 彰武县| 乡城县| 无棣县| 台东市| 通渭县| 新乡市| 宁夏| 甘泉县| 福建省| 临猗县| 化州市| 大理市| 甘德县| 涿鹿县| 仙游县| 彝良县| 安西县| 阿勒泰市|