//代码是这样的
package com.test.jface;import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.widgets.Listener;
public class TestWizard01 extends WizardPage implements Listener { public TestWizard01(String pageName) {
super(pageName);
setTitle("My Test WizardPage01");
setDescription("Fill your information"); } public void createControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE); //设置布局参数
GridData gd;
GridLayout gLayout = new GridLayout();
int ncol = 2;
gLayout.numColumns = ncol;
composite.setLayout(gLayout); Label idLabel = new Label(composite, SWT.NONE);
idLabel.setText("ID:");
Text idText = new Text(composite,SWT.SINGLE | SWT.BORDER); } public void handleEvent(Event event) { }}//不知道他的main方法怎么写呢?谁会?这个让我头疼了一天了。
谢谢了!

解决方案 »

  1.   

    研究一天多终于有眉目了。我觉得swt+jface还是不错
    对于我的这个问题我来回答吧
    1。在代码的createControl 方法的最后加上setControl(composite); 这句
    2。同样还要在写一个class他要 extends Wizard  ,代码是
    public class SimpleWizard extends Wizard {
    public SimpleWizard() { setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(null,
    "icon/user.gif"));
    // Add the pages
    //顺序很重要
    addPage(new TestWizard01());
    }
    public boolean performFinish() {

    return true;
    }
    }
    3。下面的就是它的main方法
    public class UserRun {
    public void run() {
    Display display = new Display(); // Create the parent shell for the dialog, but don't show it
    Shell shell = new Shell(display); // Create the dialog
    WizardDialog dlg = new WizardDialog(shell, new UserWizard());
    dlg.open(); // Dispose the display
    display.dispose();
    } public static void main(String[] args) {
    new UserRun().run();
    }
    }一切ok。我看这个开发的要比swing的界面好看些,但就是哪个dll文件怎么让他自动拷到system32中不知道该怎么办