I try to make scroll working and I also want to auto resize window and content that is in the window. My interface is going to have couple of composite blocks that are going to parse some information, and fields inside block are static and they going to be always same fields in same block `
public void open() {
Display display = Display.getDefault();
createContents();
shell.addListener (SWT.Resize, new Listener () {
public void handleEvent (Event e) {
Rectangle rect = shell.getClientArea ();
System.out.println(rect);
}
});
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
}
/**
* Create contents of the window.
*/
protected void createContents() {
shell = new Shell(SWT.SHELL_TRIM |SWT.V_SCROLL | SWT.H_SCROLL);
shell.addMouseWheelListener(new MouseWheelListener() {
public void mouseScrolled(MouseEvent e) {
}
});
shell.setSize(1546, 878);
shell.setBackground(SWTResourceManager.getColor(255, 255, 255));
shell.setMaximized(true);
shell.setMinimumSize(1500, 600);
shell.setText("Test App for nothing");
shell.setLayout(new FillLayout(SWT.HORIZONTAL));