import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
public class Mb {
private static Display display;
private static Shell shell;
private static Composite composite;
public static void init(){
display = new Display();
shell = new Shell(display,SWT.SHELL_TRIM);
shell.setSize(215, 550);
shell.open();

}
public static void init_1(){
while(!shell.isDisposed())
{
if(!display.readAndDispatch())
display.sleep();
}
display.dispose();
} public static void 上(){
init();
Label label = new Label(shell,SWT.NO);
label.setText("aaa");
label.setBounds(0, 0, 100, 20);
init_1();
}
public static void 下(){
init();
Label label_1 = new Label(shell,SWT.NO);
label_1.setText("bb");
label_1.setBounds(0, 30, 100, 20);
init_1();
}
}
这是我写的方法public class mainT { /**
 * @param args
 */
public static void main(String[] args) {
// TODO Auto-generated method stub


}}
这是我写的主类;
问题是这样的 。我调用Mb.上();和Mb.下();想在同一个窗口上显示出来我写的两个方法,但是现在我写的两个方法中.调用这两个方法的时候,必须一个关闭一个窗口后才能显示第二个窗口,而不是在同一个窗口上显示.
我的问题要是解决了.我会把分马上就给.因为我在线等。