• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            twzheng's cppblog

            『站在風口浪尖緊握住鼠標旋轉!』 http://www.cnblogs.com/twzheng

              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
              136 隨筆 :: 78 文章 :: 353 評論 :: 0 Trackbacks

            AsWing布局管理——FlowLayout
            [原文] http://harryxu.cn/blog/?p=113   [原文中有flash效果演示]
            FlowLayout使容器內的組件按從左到右的順序排列,每個組件都按最合適的大小顯示,直到這一行放不下后,會換到下一行,類似于文本書寫的形式。

            Actionscript:

            package
            {
            import flash.display.Sprite;
            import flash.display.StageScaleMode;

             

            import org.aswing.JFrame;
            import org.aswing.JButton;
            import org.aswing.FlowLayout;
            import org.aswing.JTextArea;
            import org.aswing.JLabel;
            import org.aswing.AsWingManager;

            public class FlowLayoutTest extends Sprite
            {
                public function FlowLayoutTest()
                {
                    AsWingManager.setRoot(this);
                   
                    var frame:JFrame = new JFrame(this, "FlowLayoutTest");
                    frame.getContentPane().setLayout(new FlowLayout());
                   
                    var label1:JLabel = new JLabel("JLabel");
                    var button1:JButton = new JButton("btn1");
                    var button2:JButton = new JButton("buttttttton2");
                    var button3:JButton = new JButton("button");
                    var text1:JTextArea = new JTextArea("改變窗口的寬度查看效果");   
                   
                    frame.getContentPane().appendAll(label1, button1, button2, button3, text1);
                   
                    frame.show();
                    frame.setSizeWH(160, 280);
                   
                    stage.scaleMode = StageScaleMode.NO_SCALE;
                }
            }
            }



            AsWing布局管理——EmptyLayout

            [原文] http://harryxu.cn/blog/?p=112
            EmptyLayout是對LayoutManager接口的空實現,是其他布局管理的基類,如果要對容器內組件進行絕對定位和大小控制,可以使用EmptyLayout

            Actionscript:

            package
            {
            import flash.display.Sprite;
            import flash.display.StageScaleMode;

             

            import org.aswing.AsWingManager;
            import org.aswing.JFrame;
            import org.aswing.JButton;
            import org.aswing.EmptyLayout;

            public class EmptyLayoutTest extends Sprite
            {
                public function EmptyLayoutTest()
                {
                    AsWingManager.setRoot(this);
                   
                    var frame:JFrame = new JFrame(this, "EmptyLayoutTest");
                    frame.getContentPane().setLayout(new EmptyLayout());
                   
                    var button1:JButton = new JButton("button1");
                    button1.setSizeWH(80, 30);
                    button1.setLocationXY(50, 20);
                    frame.getContentPane().append(button1);
                   
                    var button2:JButton = new JButton("button2");
                    button2.setSizeWH(200,150);
                    button2.setLocationXY(60, 70);
                    frame.getContentPane().append(button2);  
                   
                    frame.show();
                    frame.setSizeWH(350, 280);
                   
                    this.stage.scaleMode = StageScaleMode.NO_SCALE;
                }
            }
            }


            AsWing布局管理——BorderLayout
            [原文] http://harryxu.cn/blog/?p=111

            感覺學AsWing應該先熟悉他的布局管理,才能靈活運用,組合出各種界面

            從現在就記錄一下平時學到的布局管理器的使用方法,還請大大們指教 :[smile]:

            BorderLayout: 個人感覺邊框布局是一種使用起來比較簡單的布局方式,他將容器分為5各部分 東南西北中,每一個區域中可以容納一個組件,使用的時候也是通過BorderLayout中的5個方位常量(NORTH, WEST等)來確定組件所在的位置。

            Actionscript:

            package
            {

             

            import flash.display.Sprite;
            import flash.display.StageScaleMode;

            import org.aswing.AsWingManager;
            import org.aswing.JFrame;
            import org.aswing.JButton;
            import org.aswing.BorderLayout;
               
            public class BorderLayoutTest extends Sprite
            {
                public function BorderLayoutTest():void
                {
                    AsWingManager.setRoot(this);
                   
                    var frame:JFrame = new JFrame(this, "BorderLayout");
                   
                    // BorderLayout 構造函數的2個參數分別為 hgap 和 vgap
                    // 用于設定組件之間的水平間隙和垂直間隙
                    frame.getContentPane().setLayout(new BorderLayout(5, 5));
                   
                    var button1:JButton = new JButton("Button North");
                    frame.getContentPane().append(button1, BorderLayout.NORTH);
                   
                    var button2:JButton = new JButton("Button West");
                    frame.getContentPane().append(button2, BorderLayout.WEST);
                   
                    var button3:JButton = new JButton("Button South");
                    frame.getContentPane().append(button3, BorderLayout.SOUTH);
                   
                    var button4:JButton = new JButton("Button East");
                    frame.getContentPane().append(button4, BorderLayout.EAST);
                   
                    var button5:JButton = new JButton("Button Center");
                    frame.getContentPane().append(button5, BorderLayout.CENTER);

                    frame.show();
                    frame.setSizeWH(350, 280);
                   
                   
                   
                    this.stage.scaleMode = StageScaleMode.NO_SCALE;
                   
                }
            }
            }

            posted on 2007-10-05 15:57 譚文政 閱讀(1565) 評論(0)  編輯 收藏 引用 所屬分類: AsWing
            久久夜色精品国产| 久久99精品久久久久久久久久 | 一本综合久久国产二区| 午夜精品久久久久| 久久精品国产亚洲AV无码偷窥| 久久九九精品99国产精品| 亚洲国产成人久久精品影视| 久久中文字幕视频、最近更新 | 国产精品伦理久久久久久| 久久免费大片| 久久综合综合久久综合| 狠狠精品干练久久久无码中文字幕 | 亚洲AV无码久久精品成人| 精品久久久久久综合日本| 中文字幕无码久久人妻| 久久99精品国产麻豆宅宅| 久久久精品国产| 精品多毛少妇人妻AV免费久久| 久久夜色精品国产欧美乱| 日韩久久无码免费毛片软件| 国产一级做a爰片久久毛片| 精品久久久久久国产| 久久久久国产视频电影| 久久精品一区二区国产| 久久久无码精品亚洲日韩蜜臀浪潮| 久久夜色撩人精品国产| 91久久精品电影| 婷婷综合久久狠狠色99h| 久久久久久精品久久久久| 亚洲第一永久AV网站久久精品男人的天堂AV | 国产成人久久精品麻豆一区| 久久精品欧美日韩精品| 久久久噜噜噜久久中文字幕色伊伊| 久久精品成人| 久久影院午夜理论片无码| 久久丝袜精品中文字幕| 国产精品伦理久久久久久| 久久久久婷婷| 无码8090精品久久一区| 亚洲精品国精品久久99热| 伊人色综合九久久天天蜜桃|