救命啊
Shell shell = new Shell();
shell.setSize(500, 375);
shell.setText("图像处理");
GridLayout gridLayout = new GridLayout(5,true);
Composite composite = new Composite(shell, SWT.BORDER);
composite.setLayout(gridLayout);
GridData da = new GridData();
da.horizontalSpan = 2;
da.horizontalAlignment = SWT.FILL;
Button bt = new Button(composite,SWT.PUSH);
bt.setText("5");
bt.setLayoutData(da);
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
为什么这样不能显示按键5出来,运行通过是没有问题
我是想问下,在面板composite中建立一个GridLayout,在里面再建一个GridData,是不是可以上面那样的,谢谢
如果不,那应该怎么办,我就是想在shell中建个面板,在面板中建立一个GridLayout,,再创建一个按钮!