<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    FORTUNE

    THE WAY TO THE MASTER...
    posts - 49, comments - 18, trackbacks - 0, articles - 1
      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

    SWT Layout - RowLayout

    Posted on 2006-03-08 19:01 fortune 閱讀(975) 評論(0)  編輯  收藏 所屬分類: 我的學習筆記
    RowLayout要比FillLayout使用多些,每個widget的長度和寬度都可以通過方法setLayout()設定widget的RowData。

    Type域
    指定按行或列排列  如: new RowLayout(SWT.HORIZONTAL);default:horizontal

    Wrap域
    指定該行或列空間不足放下當前控件時是否自動換行;default:true

    Pack域
    指定Layout中的widgets是否采用它們的自然大小,如果pack為false則所有widget強制為相同大小default:true

    Justify域
    true表明Layout中的所有widgets每行都從左到右平均距離展開default:false

    MarginLeft, MarginTop, MarginRight, MarginBottom and Spacing

    前面4個是指定于邊框距離的,spacing指定widget之間的間隔

       RowLayout rowLayout = new RowLayout();

       rowLayout.wrap = false;

       rowLayout.pack = false;

       rowLayout.justify = true;

       rowLayout.type = SWT.VERTICAL;

       rowLayout.marginLeft = 5;

       rowLayout.marginTop = 5;

       rowLayout.marginRight = 5;

       rowLayout.marginBottom = 5;

       rowLayout.spacing = 0;

       shell.setLayout(rowLayout)

     

    下面的代碼使用RowData對象來改變button的大小

    import org.eclipse.swt.*;

    import org.eclipse.swt.widgets.*;

    import org.eclipse.swt.layout.*;

     

    public class RowDataExample {

     

       public static void main(String[] args) {

           Display display = new Display();

           Shell shell = new Shell(display);

           shell.setLayout(new RowLayout());

           Button button1 = new Button(shell, SWT.PUSH);

           button1.setText("Button 1");

           button1.setLayoutData(new RowData(50, 40));

           Button button2 = new Button(shell, SWT.PUSH);

           button2.setText("Button 2");

           button2.setLayoutData(new RowData(50, 30));

           Button button3 = new Button(shell, SWT.PUSH);

           button3.setText("Button 3");

           button3.setLayoutData(new RowData(50, 20));

           shell.pack();

           shell.open();

           while (!shell.isDisposed()) {

              if (!display.readAndDispatch()) display.sleep();

           }

       }

    }

     

    參考:http://www.eclipse.org/articles/Understanding%20Layouts/Understanding%20Layouts.htm

    主站蜘蛛池模板: 久久精品免费全国观看国产| 一级做a爰黑人又硬又粗免费看51社区国产精品视 | 亚洲伦理中文字幕| 131美女爱做免费毛片| 亚洲好看的理论片电影| 久久久久国色av免费看| 国产AV无码专区亚洲AV毛网站| 国产精品免费观看视频| 亚洲国产成人片在线观看无码 | 伊人久久大香线蕉免费视频| 国产精品亚洲w码日韩中文| eeuss免费影院| 亚洲色无码专区在线观看| 久久免费国产精品一区二区| 亚洲性猛交XXXX| 久久国产免费观看精品| 久久亚洲中文字幕精品有坂深雪| 3344免费播放观看视频| ASS亚洲熟妇毛茸茸PICS| 高清国语自产拍免费视频国产 | 国产一区二区三区在线观看免费| 黄页网站在线观看免费| 国产亚洲老熟女视频| 99热这里有免费国产精品| 亚洲白嫩在线观看| 成人在线视频免费| 特a级免费高清黄色片| 亚洲小说区图片区另类春色| 亚洲香蕉免费有线视频| 亚洲中文字幕日本无线码| 免费乱理伦在线播放| 免费观看91视频| 亚洲国产熟亚洲女视频| 亚洲 无码 在线 专区| 爱丫爱丫影院在线观看免费| 亚洲一级高清在线中文字幕| 四虎永久免费影院| 免费黄网站在线观看| 久久亚洲精品国产亚洲老地址| 国产成人精品亚洲精品| 亚州免费一级毛片|