|
Re: SWT Filllayout [message #717008 is a reply to message #716892] |
Fri, 19 August 2011 04:25 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
use GridLayout with 10 columns and give control 1 Griddata(Griddata.FILL_BOTH) with a horizontal span of 9 and control 2 with Griddata(Griddata.FILL_BOTH) single span.
something like this
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
public class SWTGridExample{
public SWTGridExample() {
Display d = new Display();
Shell s = new Shell(d);
s.setLayout(new GridLayout(10, true));
Text t1 = new Text(s, SWT.BORDER);
GridData layoutData = new GridData(GridData.FILL_BOTH);
layoutData.horizontalSpan = 9;
t1.setLayoutData(layoutData);
Text t2 = new Text(s, SWT.BORDER);
t2.setLayoutData(new GridData(GridData.FILL_BOTH));
s.open();
while (!s.isDisposed()) {
if (!d.readAndDispatch())
d.sleep();
}
d.dispose();
}
public static void main(String[] argv) {
new SWTGridExample();
}
}
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
|
Re: SWT Filllayout [message #717047 is a reply to message #717035] |
Fri, 19 August 2011 07:08 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
same Gridlayout but with single column and control 2 griddata will have a height hint of 10 and control 1 will have Griddata(Griddata.FILL_HORIZONTAL) and verticalAlignment=SWT.BOTTOM.
you have to explore different paramaters of the griddata to play around...
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03365 seconds