I'm having an issue with vertical scrolling, the scrolling bar appears on my shell but when I move the scroll bar the labels and the text inputs that located in the shell doesn't move. I deleted some code from the method that I think is irrelevant to the case, let me know if to post the full code. Thanks ahead.
public void initWidgets(String[] strings) throws IOException{
GridData[] grids = new GridData[strings.length];
for(int i=0;i<strings.length;i++){
grids[i] = new GridData(SWT.FILL, SWT.FILL, true, true);
}
Display display = new Display();
final Shell shell = new Shell(display,SWT.SHELL_TRIM | SWT.V_SCROLL);
shell.setSize(300, 500);
GridLayout gridLayout = new GridLayout(2,false);
shell.setLayout(gridLayout);
shell.setText("Triggers Test");
HashMap<String[], Text[][]> hm = new HashMap<>();
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
gridData.horizontalSpan = 2;
Text[][] txt = new Text[strings.length][3];
for(int i=0;i<strings.length;i++){
Label label = new Label(shell, SWT.NONE);
label.setText(strings[i]+":");
label.setLayoutData(gridData);
FontData fontData = label.getFont().getFontData()[0];
Font font = new Font(display, new FontData(fontData.getName(), fontData
.getHeight(), SWT.BOLD | SWT.ITALIC));
label.setFont(font);
Label label2 = new Label(shell, SWT.NONE);
label2.setText("Yesterday's number:");
Text t1 = new Text(shell, SWT.SINGLE | SWT.BORDER);
t1.setLayoutData(grids[0]);
Label label3 = new Label(shell, SWT.NONE);
label3.setText("From the day before:");
Text t2 = new Text(shell, SWT.SINGLE | SWT.BORDER);
t2.setLayoutData(grids[0]);
Label label4 = new Label(shell, SWT.NONE);
label4.setText("3 Months Average:");
Text t3 = new Text(shell, SWT.SINGLE | SWT.BORDER);
t3.setLayoutData(grids[0]);
}
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}