“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應用通常只需一個(gè)單一的display。而支持swt的一些平臺根本就不允許多個(gè)活動(dòng)的display。換句話(huà)說(shuō),在現存的display沒(méi)有dispose之前,根本就不允許創(chuàng )建新的display。
【有時(shí)間就翻著(zhù)玩了,權當練習打字。因為很多程序員英語(yǔ)不好,可是卻是很優(yōu)秀的:)】
3。
SWT/JFace開(kāi)發(fā)入門(mén)指南(三)
http://www.blogjava.net/jayliu/archive/2005/05/19/4875.html
google了一下發(fā)現,這位幻GG也從csdn搬到blogjava來(lái)了。竟然還和我一樣的blog模板
注:
Label label1=new Label(shell,SWT.CENTER);
這里引入包的時(shí)候需要注意import org.eclipse.swt.widgets.Label;
不要順手引入awt的Label,會(huì )出問(wèn)題的。當然,如果是import org.eclipse.swt.widgets.*那自然萬(wàn)事大吉。
shell.setText("Labels");//這個(gè)寫(xiě)在Form上嘍
Label label1=new Label(shell,SWT.CENTER);
label1.setText("LabelDemo");//文本顯示
Label label2=new Label(shell,SWT.SEPARATOR|SWT.HORIZONTAL);//這個(gè)就顯示成一個(gè)分隔線(xiàn)
4。
SWT/JFace開(kāi)發(fā)入門(mén)指南(四)
http://blog.csdn.net/jayliu/archive/2005/05/12/374082.aspx
注:
不知為什么,第一個(gè)代碼示例中采用SelectionListener的方法總是不能成功,
還好有第二個(gè)更簡(jiǎn)單的使用adapter改良方法,所以沒(méi)成功也就沒(méi)有多加注意。
時(shí)間不等人。研究工作少做一點(diǎn),等深入了解后會(huì )慢慢明白的。
此外_shell的get、set方法和變量名不對應,我的習慣是寫(xiě)了變量就直接Alt+
sr,所以生成的方法名和變量名都是對應的。不知道這個(gè)算不算一個(gè)小技巧:
)
聯(lián)系客服