我想让我的shell不能被别人改变大小,该如何设置啊

解决方案 »

  1.   

    new Shell(parent, style);第二个参数SWT.NONE就可以了。
      

  2.   

    用SWT.NONE不好啊 ,这样窗口就太难看了
      

  3.   

    swt 不是很熟悉,不知道有没有类似与swing的setResizable方法,楼主可以查下api
    要是有的话,就可以了,没的话还是在api中找答案吧。
      

  4.   

    new Shell(SWT.CLOSE);
    只带CLOSE按钮的Shell就可以!
      

  5.   

    setShellStyle(SWT.MODELESS | SWT.DIALOG_TRIM | getDefaultOrientation());
      

  6.   

    我给你写了个
    这个就是,然后红字的就是要设置窗口不被改变大小的
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Shell;
    public class shell extends Shell {
    public static void main(String args[]) {
    try {
    Display display = Display.getDefault();
    shell shell = new shell(display, SWT.MIN);
    shell.open();
    shell.layout();
    while (!shell.isDisposed()) {
    if (!display.readAndDispatch())
    display.sleep();
    }
    } catch (Exception e) {
    e.printStackTrace();
    }
    } public shell(Display display, int style) {
    super(display, style);
    createContents();
    } protected void createContents() {
    setText("SWT Application");
    setSize(500, 375);
    } @Override
    protected void checkSubclass() {
    // Disable the check that prevents subclassing of SWT components
    }}