2020国产成人精品视频,性做久久久久久久久,亚洲国产成人久久综合一区,亚洲影院天堂中文av色

分享

Ecipse 3.0.1 和VE插件安裝實(shí)戰(zhàn)攻略

 fordoc 2006-01-20
Ecipse 3.0.1 和VE插件安裝實(shí)戰(zhàn)攻略

 早就聽說Eclipse的鼎鼎大名,瀏覽了好多關(guān)于Eclipse的文章,聽說用SWT,JFace能設(shè)計(jì)出擁有本地操作系統(tǒng)界面風(fēng)格的東東,如果在XP上運(yùn)行,豈不是很讓客戶滿意,近期要做個(gè)桌面系統(tǒng),^_^....., 想Trying 下.
用Eclipse當(dāng)然就要裝上再說,這兩天我是吃勁了苦頭..., 下載了很多東西,讀了很多文章,終于調(diào)通了,現(xiàn)在給大家分享下.我沒有找到完整的安裝攻略,現(xiàn)在就寫一個(gè)最新的.....  建議您先瀏覽下Eclipse網(wǎng)站  
http://www.  尤其是 Projects 連接, 其中的Eclipse Projiect, 和 Eclipse Tools Project.
Eclipse (Eclipse SDK 最新的是3.0.2) 是一個(gè)平臺(tái),其中的JDT,PDE都是集成在Eclipse下載的,SWT,JFace開發(fā)包也是,不用關(guān)心太多,有些文章說的很多,反而讓新手迷惑...
Eclipse Tool Project 主要用到. Graphical Editor Framework (GEF) Project, EMF, VE  
不要急于下載這些東東,我算是吃勁苦頭......
用Eclipse當(dāng)然希望用它的可視化編程(Visual Edit Project) 插件. 現(xiàn)在最新的是 VE1.0.2.1下載頁 
http://www./vep/
現(xiàn)看它的下載需求!!!!!  原來VE只能和相應(yīng)版本的GEF,EMF,Eclipse SDK,一起工作,如果先前你下載了其他的高版本,都糟踐的,關(guān)鍵是耽誤自己的時(shí)間.
好了,攻略開始.建個(gè)下載文件夾.
下載VE(1.0.2.1)
在同一個(gè)頁面的需求里下載 Eclipse SDK 3.0.1, EMF 2.0.1, GEF3.0.1
解壓縮Eclipse SDK 3.0.1, 把解壓縮里的 eclipse 文件夾拷貝到D:\
看看里邊的內(nèi)容,主要是plugins,features
解壓縮 EMF 到\emf 文件夾, 把emf\plugins 的東西都拷貝到d:\eclipse\plugins, emf\features 下的東西拷貝到d:\eclipse\features 
VE,GEF 操作同上...
重要的,Eclipse 3.0.1 需要 JDK1.4.2, 所以要先安裝它.JDK的路徑設(shè)置就不再說了.....\bin, \lib , \jdk1.4.2
由于運(yùn)行SWT的程序用到本地庫,因此拷貝 D:\eclipse\plugins\org.eclipse.swt.win32_3.0.1\os\win32\x86 下的 *.dll 拷貝到 jdk路徑下的 \bin 目錄, 運(yùn)行程序可以自動(dòng)找到.  這些問題都困擾了我好長時(shí)間.
現(xiàn)在啟動(dòng) d:\eclipse\eclipse.exe  
^_^^_^,都OK了
eclipse 能自動(dòng)認(rèn)出你的JRE.
實(shí)戰(zhàn)!
啟動(dòng)eclipse,看看welcome project 吧,不錯(cuò)... 界面很迷人!
新建一個(gè)項(xiàng)目 file->New->project 出來項(xiàng)目向?qū)? 選擇java project.  ->next 輸入project Name:Hello  Eclipse自動(dòng)給你建個(gè)workspace 工作文件夾,你的項(xiàng)目都存在這里的,d:\eclipse\workspace  點(diǎn)擊結(jié)束. 一個(gè)新項(xiàng)目建成了.
添加SWT ToolKit, 菜單Project->Properties 選擇左側(cè)的 Java Build Path  選擇 右側(cè)的 Libraries 標(biāo)簽頁, 點(diǎn)擊 Add Library 按鈕, 選擇 Standard Widget Toolkit(SWT)  點(diǎn)擊 Next , 選上 Include support for JFace library  結(jié)束.這樣就可以使用 SWT Jface控件了.
選中你的project Hello. 選擇新建圖標(biāo)按鈕, 上端最左側(cè)的. 選擇 Visual Class ,點(diǎn)擊Next , Source Folder 是缺省的 project folder, package 填入 test, Name 填入 FrmHello  , 展開左側(cè)的 SWT 選擇 Shell, 勾選上 public static void main(String[] args), Constructors from superclass, Inherited abstract methods. 結(jié)束.
Eclipse自動(dòng)啟動(dòng) VE.... 看看那些窗口... 比較熟悉.. 出現(xiàn)了可視化編輯窗口.
鼠標(biāo)移到右側(cè)的Palette(豎著的那個(gè))把 一個(gè)Label,一個(gè)Button, 一個(gè)TextArea 放到shell上.
選中Label, 在下側(cè)的Properties屬性欄可以進(jìn)行設(shè)置, >text 填入Hello World
選中 Button 在下側(cè)的Properties屬性欄可以進(jìn)行設(shè)置, >text 填入Click Me.
選中 Button 右鍵, events->Add Events . 選擇Mouse - MouseAdapter ->mouseDown.  相應(yīng)的代碼自動(dòng)產(chǎn)生.添加如下代碼(藍(lán)色部分)
也可進(jìn)行其他的風(fēng)格設(shè)置, 但是如果JDK版本不對(duì)則不能操作.有錯(cuò)...
全部代碼:
/*
* Created on 2005-4-20
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package test;

import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Text;
/**
* @author w19284
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class FrmHello {

private org.eclipse.swt.widgets.Shell sShell = null; // @jve:decl-index=0:visual-constraint="41,12"
private Label label = null;
private Button button = null;
private Text textArea = null;
/**

*/
public FrmHello() {
super();
// TODO Auto-generated constructor stub
}

public static void main(String[] args) {
/* Before this is run, be sure to set up the following in the launch configuration 
* (Arguments->VM Arguments) for the correct SWT library path. 
* The following is a windows example:
* -Djava.library.path="installation_directory\plugins\org.eclipse.swt.win32_3.0.0\os\win32\x86"
*/
org.eclipse.swt.widgets.Display display = org.eclipse.swt.widgets.Display.getDefault(); 
FrmHello thisClass = new FrmHello();
thisClass.createSShell() ;
thisClass.sShell.open();

while (!thisClass.sShell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep ();
}
display.dispose(); 
}

/**
* This method initializes sShell
*/
private void createSShell() {
sShell = new org.eclipse.swt.widgets.Shell(); 
label = new Label(sShell, SWT.NONE);
button = new Button(sShell, SWT.NONE);
textArea = new Text(sShell, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
sShell.setText("Shell");
sShell.setBackground(org.eclipse.swt.widgets.Display.getDefault().getSystemColor(org.eclipse.swt.SWT.COLOR_TITLE_BACKGROUND_GRADIENT));
label.setBounds(new org.eclipse.swt.graphics.Rectangle(167,5,96,24));
label.setText("Hello World");
label.setBackground(org.eclipse.swt.widgets.Display.getDefault().getSystemColor(org.eclipse.swt.SWT.COLOR_INFO_BACKGROUND));
label.setFont(new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getDefault(), "Times New Roman", 12, org.eclipse.swt.SWT.BOLD));
button.setBounds(new org.eclipse.swt.graphics.Rectangle(152,34,123,24));
button.setText("Click Me");
button.setFont(new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getDefault(), "Times New Roman", 14, org.eclipse.swt.SWT.NORMAL));
textArea.setBounds(new org.eclipse.swt.graphics.Rectangle(64,70,323,123));
sShell.setSize(new org.eclipse.swt.graphics.Point(451,232));
button.addMouseListener(new org.eclipse.swt.events.MouseAdapter() { 
public void mouseDown(org.eclipse.swt.events.MouseEvent e) { 
System.out.println("mouseDown()"); // TODO Auto-generated Event stub mouseDown()
textArea.setText(textArea.getText() + "|Hello,Eclipse");
}
});
}
}
好了,大功馬上告成.  選擇運(yùn)行圖標(biāo), toolBar 上的綠色按鈕旁邊的黑下箭頭.選擇->run.., 選擇左側(cè)的java Application 點(diǎn)擊下面的新建.  選擇中間Main標(biāo)簽頁, Project 選擇Hello , Main class: 選擇test.FrmHello.  點(diǎn)擊 run 按鈕. 
界面出來了...., 以后你就可以直接點(diǎn)擊Run圖標(biāo),運(yùn)行這個(gè)程序.  點(diǎn)擊Click Me 看看TextArea的變化...

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請遵守用戶 評(píng)論公約

    類似文章 更多