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

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


    網站導航:
     
    主站蜘蛛池模板: 国产嫩草影院精品免费网址| 99re在线精品视频免费| 免费观看男人免费桶女人视频 | 免费在线观看一级毛片| 亚洲精华国产精华精华液网站| 国产在线观看片a免费观看 | 婷婷亚洲久悠悠色悠在线播放| 免费91麻豆精品国产自产在线观看 | 国产a级特黄的片子视频免费| 午夜亚洲WWW湿好爽| 四虎永久在线精品视频免费观看| 亚洲av永久无码精品秋霞电影秋| 永久中文字幕免费视频网站| 免费又黄又爽又猛大片午夜| 亚洲伊人久久综合影院| 国色精品va在线观看免费视频 | 免费在线观看亚洲| 久久久久亚洲AV无码专区桃色| 中文字幕不卡高清免费| 亚洲欧洲日韩不卡| 91香蕉视频免费| 无码色偷偷亚洲国内自拍| ZZIJZZIJ亚洲日本少妇JIZJIZ| 免费成人在线视频观看| 亚洲人成网站在线观看播放动漫| 成人免费午夜视频| 五月天国产成人AV免费观看| 久久久久亚洲av无码专区蜜芽| 国产免费久久精品99re丫y| 看亚洲a级一级毛片| 亚洲AV无码一区二区乱孑伦AS| 国产h肉在线视频免费观看| 久久精品亚洲日本波多野结衣| 在线a亚洲v天堂网2019无码| 91成人免费在线视频| 免费国产黄网站在线观看动图 | 中国在线观看免费高清完整版 | 最近2019免费中文字幕视频三| 亚洲欧洲专线一区| 国产∨亚洲V天堂无码久久久| 国产成人免费爽爽爽视频|