在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]

本文介绍了Swt中Shell组件的使用方法,包括如何创建主窗口和子窗口,并详细解释了构造函数参数的意义以及Shell的不同样式。
356

被折叠的 条评论
为什么被折叠?



