SWT中button的image问题

我利用SWTDesigner建了一个toolbar和toolitem,想将这个item用图标显示,写了如下语句:。。。Displaydisplay=Display.get... 我利用SWT Designer建了一个toolbar和toolitem,想将这个item用图标显示,写了如下语句:
。。。
Display display=Display.getDefault();
。。。
toolItem.setImage(new Image(display,"E:\\images\\selectall.gif"));

但是运行的时候,只有一个界面,其中的toolitem都不显示了,网上搜了一下,改为:Display display=new Display();和Display display=Display.getCurrent()都不行,这是为什么呢?谢谢指点!

qq:173635235
msn:bisal1130@yahoo.com.cn
展开
 我来答
qqfz2
2008-02-20 · TA获得超过1090个赞
知道小有建树答主
回答量:290
采纳率:0%
帮助的人:222万
展开全部
Java 编程初步 傻瓜书
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=159167
数据结与算法 Java语言版
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=160250
精通JBuilder 2005 中文版 高清PDF+随书光盘
http://bbs.topsage.com/dispbbs_121_172861_1.html
JSF JavaServer Faces in Action
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=160229
Spring in Action (第二版)
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=146170
Manning jQuery in Action
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174769
Spring In Action
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174107
AspectJ in Action
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174106
Hibernate In Action
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174105
Struts in Action
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174005
Lucene in Action
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=173991
Wrox出版 Beginning Spring Framework 2
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=175714
Java Extreme Programming Cookbook
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174729
Java Programming Cookbook
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=173667
Beginning Java Objects
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174685
Building Java Enterprise App
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174684
Ant: The Definitive Guide
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174683
Better Faster Lighter Java
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174681
Hibernate Reference 3.1
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174674
Pragmatic Version Control using CVS
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174479
Pragmatic Project Automation
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174476
jQuery Reference Guide
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174411
Java 2 核心技术 卷1&卷2 CHM版
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174123
Wrox Professional Java JDK 6 Edition
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=163451
Java 2 宝典
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=159154
侯捷java编程思想 PDF中文版
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=163902
Learning Java (第三版)
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=146869
The Java Language Specification
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=176082
Beginning Java Programming for Dummies 第二版
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=163923
Java 2 核心编程
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=146174
Java How to Program (第六版)
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=146371
Java All-In-One案头参考傻瓜书 (第二版)
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=152871
21天自学 Java 6 (2007年5月更新出版) PDF
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=159315
Java咖啡馆
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=151447
Thinking in Java(第四版)
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=152053
深入学习JFC SWING - Java基础类组件集
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=152049
J2EE全实例教程
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=158057
Java信息系统设计与开发实例(第二版)
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=151993
Java优化编程
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=151994
Effective Java
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=175258
Java信息系统设计与开发实例(第二版)
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=151993
Tricks of the Java Programming
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=159305
Wrox Professional Java Native Interfaces with SWT JFace
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=159290
Java Swing 第二版 PDF文字版 O'Relliy出版
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=159158
O'Reilly - Java Database Programming with JDBC
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=159292
JDBC与Java数据库程序设计
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=151448
Learning JQurey (2007年7月最新出版)
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=159652
J2EE with BEA WebLogic Server
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=176088
Pragmatic Unit Testing in Java with JUnit
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=176084
Wiley出版 J2EE 1.4 Bible
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=176080
J2EE设计开发编程指南
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=159288
Java Web Services简明教程
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=159159
O'Reilly Java and XML (第二版PDF)
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=146231
O'Reilly Java and XML (第三版PDF)
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=167584
Java技术XML高级编程
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=147800
Expert One-on-One J2EE Design and Development
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=160652
Expert One-on-One J2EE Development without EJB
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=160653
JBoss - A Developer's Notebook
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=146179
The Java Programming Language (第四版)
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=147095
Professional Java Development with the Spring Framework
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=159303
Core Java Server Faces 第二版
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=145549
精通Enterprise JavaBeans
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=146018
Enterprise JavaBeans EJB 第四版
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=159166
J2EE应用与BEA WebLogic Server (第二版PDF)
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=146227
O'Reilly Java Web Services
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=146377
Ant权威指南
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=148383
Ajax和Java框架高级编程
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=148371
Java Web Services简明教程
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=159159
Cross-Platform Web Services Using C# and Java
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=160472
O'Reilly Ajax on Java
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=160600
O'Reilly Java and XSLT
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=149585
O'Reilly Java and XML Binding
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=149583
O'Reilly Java and SOAP
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=149581
Design Patterns Java Companion
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=163920
J2EE Java黑客大曝光 开发安全的Java应用程序
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=151446
J2ME API 速查手册
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=158248
精通J2ME无线编程
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=152047
J2ME开发大全
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=151987
Java网页开发的艺术
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=151991
Java编程高手
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=151990
Java 5.0 Tiger程序高手秘笈
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=151989
Java2网络协议技术内幕(附源码)
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=151988
Using Enterprise JavaBeans 2
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=166051
Java技术实用教程
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=158244
企业级Java安全性(构建安全的J2EE应用)
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=152048
Java语言集成开发环境Eclipse中文教程
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=158237
NetBeans IDE 5.5 企业版高级开发教程
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=159653
Using Enterprise JavaBeans 2
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=166051
Borland JBuilder Developer's Guide
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=166294
Eclipse [O'Reilly]
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=175257
Eclipse精要与高级开发技术
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=151986
Code Generation in Action
http://bbs.topsage.com/dispbbs.asp?boardID=121&ID=174722
ms16211803
2008-02-21 · TA获得超过166个赞
知道小有建树答主
回答量:276
采纳率:0%
帮助的人:138万
展开全部
Display display = new Display();
// 创建图片对象,该图片对象设置选项卡上的图标
Image image = new Image(
display,
"G:\\workspace\\eclipse3.3\\SWTWork\\icons\\full\\etool16\\samples.gif");
CTabItem item = new CTabItem(folder, SWT.CLOSE);
item.setImage(image);
image.dispose();
display.dispose();
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式