在Swt里面 Shell可充当主要窗口的角色 也可充当子窗口或者对话框的角色 如果要建立一个主要窗口的话 应该在构造方法里面添加Display为参数 如果是创建子窗口或者对话框就应该在构造函数里添加父窗口的Shell
Shell parent = new Shell(Display display, int style); 建立主窗口
Shell dialog = new Shell(Shell parent, int style); 建立子窗口
以下为Shell的不同样式
[img]http://dl.iteye.com/upload/attachment/563666/f95d7b70-f7c7-328c-8102-3a474cbc0333.jpg[/img]
Shell parent = new Shell(Display display, int style); 建立主窗口
Shell dialog = new Shell(Shell parent, int style); 建立子窗口
以下为Shell的不同样式
[img]http://dl.iteye.com/upload/attachment/563666/f95d7b70-f7c7-328c-8102-3a474cbc0333.jpg[/img]