写个类 然后用swt再画个画面 普通类传一个值给画面 让画面show出来 
写好后整个过程告诉我就行了。。

解决方案 »

  1.   

    不太领会,给个简单的例子吧!import org.eclipse.swt.layout.GridLayout;
    import org.eclipse.swt.graphics.Point;
    import org.eclipse.swt.widgets.Shell;
    import org.eclipse.swt.graphics.Color;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Label;
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.graphics.Rectangle;
    import org.eclipse.swt.graphics.Font;
    import org.eclipse.swt.widgets.Text;
    import org.eclipse.swt.widgets.Button;public class FrameLogin { Shell sShell = null;  //  @jve:decl-index=0:visual-constraint="10,10"
    private Label 用户名 = null;
    private Label 密码 = null;
    private Text text = null;
    private Text text1 = null;
    private Button button = null;
    private Button button1 = null;
    /**
     * This method initializes sShell
     */
    void createSShell() {
    sShell = new Shell();
    sShell.setText("登录");
    sShell.setBackground(new Color(Display.getCurrent(), 255, 255, 255));
    sShell.setSize(new Point(251, 164));
    sShell.setLayout(null);
    用户名 = new Label(sShell, SWT.NONE);
    用户名.setFont(new Font(Display.getDefault(), "\u5b8b\u4f53", 10, SWT.BOLD));
    用户名.setBackground(new Color(Display.getCurrent(), 255, 255, 255));
    用户名.setLocation(new Point(32, 27));
    用户名.setSize(new Point(50, 18));
    用户名.setText("用户名:");
    密码 = new Label(sShell, SWT.NONE);
    密码.setBackground(new Color(Display.getCurrent(), 255, 255, 255));
    密码.setFont(new Font(Display.getDefault(), "\u5b8b\u4f53", 9, SWT.BOLD));
    密码.setLocation(new Point(33, 63));
    密码.setSize(new Point(50, 18));
    密码.setText("密码:");
    text = new Text(sShell, SWT.BORDER);
    text.setBounds(new Rectangle(92, 29, 126, 19));
    text1 = new Text(sShell, SWT.BORDER);
    text1.setLocation(new Point(92, 62));
    text1.setSize(new Point(126, 19));
    button = new Button(sShell, SWT.NONE);
    button.setBounds(new Rectangle(32, 99, 61, 22));
    button.setText("确定");
    button1 = new Button(sShell, SWT.NONE);
    button1.setText("取消");
    button1.setBounds(new Rectangle(153, 99, 61, 22));
    }}