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

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

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

    posts - 495,  comments - 11,  trackbacks - 0

    package swt.expandbar;

    import org.eclipse.jface.resource.JFaceResources;
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.graphics.Font;
    import org.eclipse.swt.graphics.Image;
    import org.eclipse.swt.layout.FillLayout;
    import org.eclipse.swt.layout.GridLayout;
    import org.eclipse.swt.widgets.Composite;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.ExpandBar;
    import org.eclipse.swt.widgets.ExpandItem;
    import org.eclipse.swt.widgets.Label;
    import org.eclipse.swt.widgets.Link;
    import org.eclipse.swt.widgets.Shell;

    public class WindowStyle {

    public WindowStyle() {
    ?? final Display display = Display.getDefault();
    ?? final Shell shell = new Shell(SWT.MIN);
    ?? shell.setText("ExpandBar練習");
    ?? shell.setSize(200, 518);
    ?? shell.setLayout(new FillLayout());
    ??
    ?? ExpandBar expandBar = new ExpandBar(shell,SWT.V_SCROLL);
    ?? {
    ??? Composite comp1 = new Composite(expandBar,SWT.NONE);
    ??? comp1.setLayout(new GridLayout(2,false));
    ??? new Label(comp1,SWT.NONE).setImage(new Image(display,"icons/default.gif"));
    ??? new Link(comp1,SWT.NONE).setText("<a>查看系統信息</a>");
    ???
    ??? new Label(comp1,SWT.NONE).setImage(new Image(display,"icons/doc.gif"));
    ??? new Link(comp1,SWT.NONE).setText("<a>添加/刪除程序</a>");
    ???
    ??? new Label(comp1,SWT.NONE).setImage(new Image(display,"icons/main.gif"));
    ??? new Link(comp1,SWT.NONE).setText("<a>更改一個設置</a>");
    ??? ExpandItem item1 = new ExpandItem(expandBar, SWT.NONE);
    ??? item1.setText("系統任務");
    ??? item1.setHeight(75);// 設置Item的高度
    ??? item1.setControl(comp1);// setControl方法控制comp1的顯現
    ?? }
    ??
    ?? {??
    ??? Composite comp2 = new Composite(expandBar,SWT.NONE);
    ??? comp2.setLayout(new GridLayout(2,false));
    ??? new Label(comp2,SWT.NONE).setImage(new Image(display,"icons/computer.gif"));
    ??? new Link(comp2,SWT.NONE).setText("<a>網上鄰居</a>");
    ??? new Label(comp2,SWT.NONE).setImage(new Image(display,"icons/inc.gif"));
    ??? new Link(comp2,SWT.NONE).setText("<a>我的文檔</a>");
    ??? new Label(comp2,SWT.NONE).setImage(new Image(display,"icons/folder.gif"));
    ??? new Link(comp2,SWT.NONE).setText("<a>共享文檔</a>");
    ??? new Label(comp2,SWT.NONE).setImage(new Image(display,"icons/cmd.gif"));
    ??? new Link(comp2,SWT.NONE).setText("<a>控制面板</a>");
    ??? ExpandItem item1 = new ExpandItem(expandBar, SWT.NONE);
    ??? item1.setText("其他位置");
    ??? item1.setHeight(95);// 設置Item的高度
    ??? item1.setControl(comp2);// setControl方法控制comp1的顯現
    ?? }
    ??
    ?? {
    ??? Composite comp3 = new Composite(expandBar,SWT.NONE);
    ??? comp3.setLayout(new GridLayout());
    ???
    ??? // setup bold font
    ??? Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
    ??? Label l = new Label(comp3,SWT.NONE);
    ??? l.setText("我的電腦");
    ??? l.setFont(boldFont);
    ???
    ??? new Label(comp3,SWT.NONE).setText("系統文件夾");
    ???
    ??? ExpandItem item1 = new ExpandItem(expandBar, SWT.NONE);
    ??? item1.setText("詳細信息");
    ??? item1.setHeight(50);// 設置Item的高度
    ??? item1.setControl(comp3);// setControl方法控制comp1的顯現
    ?? }
    ??
    ?? shell.layout();
    ?? shell.open();
    ??
    ?? while(!shell.isDisposed()) {
    ??? if(!display.readAndDispatch())
    ???? display.sleep();
    ?? }
    ?? display.dispose();
    }


    public static void main(String[] args) {
    ?? new WindowStyle();
    }
    }

    以上程序中會用到7個icon小圖片,把他們放置在工程根目錄下的icons目錄下

    運行效果:

    Tags:java,rcp,jface,swt,ibm,eclipse,ui,gui

    posted on 2008-05-04 16:42 jadmin 閱讀(200) 評論(0)  編輯  收藏

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


    網站導航:
     
    主站蜘蛛池模板: 成年网站免费入口在线观看| 日韩a级毛片免费观看| 无遮挡呻吟娇喘视频免费播放| 亚洲精品中文字幕无乱码| 亚洲午夜福利717| 国产三级免费观看| 成人免费无码视频在线网站| 无码日韩精品一区二区三区免费| 一区二区免费国产在线观看| 色偷偷尼玛图亚洲综合| 亚洲人成黄网在线观看| 亚洲AV无码国产精品麻豆天美 | 亚洲精品高清在线| 国产精品成人四虎免费视频| 久久精品a一国产成人免费网站| 99久久99久久精品免费观看| a毛片全部播放免费视频完整18| 深夜福利在线视频免费| 在线亚洲v日韩v| 婷婷亚洲综合五月天小说在线| 亚洲日韩精品无码专区加勒比| 亚洲精品**中文毛片| 精品日韩亚洲AV无码一区二区三区| 亚洲av日韩av高潮潮喷无码| 国产∨亚洲V天堂无码久久久| 久久久久亚洲AV成人网人人网站 | 美国免费高清一级毛片| 久久无码av亚洲精品色午夜| 亚洲人成色99999在线观看| 亚洲日韩国产一区二区三区在线| 亚洲精品午夜国产va久久| 亚洲日本国产综合高清| 在线亚洲午夜片AV大片| 亚洲中文字幕一二三四区| 亚洲日韩国产二区无码| 亚洲AV无码一区二区三区网址| 国产亚洲蜜芽精品久久| 夜夜爽妓女8888视频免费观看| 一级毛片免费在线播放| 三级网站免费观看| 99精品热线在线观看免费视频|