Component doesn’t fill container on resize
Friday, June 3rd, 2011 at 12:34 pm
Comments (1)
I have [custom] component that change its width but not height on resize. Cause is probably a bug in SWT Designer. This code was auto generated and produce a problem
GroupLayout gl_shell = new GroupLayout(shell);
gl_shell.setHorizontalGroup(
gl_shell.createParallelGroup(GroupLayout.LEADING)
.add(composite, GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE)
);
gl_shell.setVerticalGroup(
gl_shell.createParallelGroup(GroupLayout.LEADING)
.add(composite)//problem here
);
that looks like:
changing code to :
gl_shell.setHorizontalGroup(
gl_shell.createParallelGroup(GroupLayout.LEADING)
.add(composite, GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE)
);
gl_shell.setVerticalGroup(
gl_shell.createParallelGroup(GroupLayout.LEADING)
.add(composite, GroupLayout.DEFAULT_SIZE, 542, Short.MAX_VALUE)
);
solve the problem.