“Applications which are built with SWT will almost always require only a single display. In particular, some platforms which SWT supports will not allow more than one active display. In other words, some platforms do not support creating a new display if one already exists that has not been sent the dispose() message.” swt應(yīng)用通常只需一個單一的display。而支持swt的一些平臺根本就不允許多個活動的display。換句話說,在現(xiàn)存的display沒有dispose之前,根本就不允許創(chuàng)建新的display。
【有時間就翻著玩了,權(quán)當(dāng)練習(xí)打字。因為很多程序員英語不好,可是卻是很優(yōu)秀的:)】
3。
SWT/JFace開發(fā)入門指南(三)
http://www.blogjava.net/jayliu/archive/2005/05/19/4875.html
google了一下發(fā)現(xiàn),這位幻GG也從csdn搬到blogjava來了。竟然還和我一樣的blog模板
注:
Label label1=new Label(shell,SWT.CENTER);
這里引入包的時候需要注意import org.eclipse.swt.widgets.Label;
不要順手引入awt的Label,會出問題的。當(dāng)然,如果是import org.eclipse.swt.widgets.*那自然萬事大吉。
shell.setText("Labels");//這個寫在Form上嘍
Label label1=new Label(shell,SWT.CENTER);
label1.setText("LabelDemo");//文本顯示
Label label2=new Label(shell,SWT.SEPARATOR|SWT.HORIZONTAL);//這個就顯示成一個分隔線
4。
SWT/JFace開發(fā)入門指南(四)
http://blog.csdn.net/jayliu/archive/2005/05/12/374082.aspx
注:
不知為什么,第一個代碼示例中采用SelectionListener的方法總是不能成功,
還好有第二個更簡單的使用adapter改良方法,所以沒成功也就沒有多加注意。
時間不等人。研究工作少做一點,等深入了解后會慢慢明白的。
此外_shell的get、set方法和變量名不對應(yīng),我的習(xí)慣是寫了變量就直接Alt+
sr,所以生成的方法名和變量名都是對應(yīng)的。不知道這個算不算一個小技巧:
)