<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 閱讀(206) 評論(0)  編輯  收藏

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


    網站導航:
     
    主站蜘蛛池模板: 亚洲片一区二区三区| 日韩精品无码永久免费网站| 精品国产呦系列在线观看免费| 99久久综合国产精品免费| 久久精品亚洲一区二区三区浴池| 在线观看特色大片免费网站| 久久精品国产亚洲综合色| a级毛片毛片免费观看永久| 国产亚洲综合久久系列| 少妇性饥渴无码A区免费| 国产亚洲成av人片在线观看| 久久99精品免费视频| 亚洲激情中文字幕| 99热在线免费播放| 国产日本亚洲一区二区三区| 四虎成人免费网址在线| 国产亚洲人成在线影院| 国产亚洲自拍一区| 国产无遮挡裸体免费视频在线观看| 黑人精品videos亚洲人| 99在线热视频只有精品免费| 亚洲国产成人99精品激情在线| 午夜色a大片在线观看免费| 亚洲av日韩av永久无码电影| 免费人成在线观看网站品爱网日本| 一级白嫩美女毛片免费| 亚洲综合婷婷久久| 四虎成人免费网站在线| 成人妇女免费播放久久久| 亚洲午夜精品一区二区| 女人18毛片水最多免费观看| eeuss草民免费| 亚洲成年人电影在线观看| 四虎影视精品永久免费| 97人妻精品全国免费视频| 最新国产精品亚洲| 国产精品V亚洲精品V日韩精品 | 日韩精品无码人妻免费视频| 免费看又黄又爽又猛的视频软件| 久久香蕉国产线看观看亚洲片| 成人黄动漫画免费网站视频 |