Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You'd better use <code>FormLayout</code>, which is more flexible than <code>GridLayout</code>. If you need it, you can get a widget <code>FormData</code>, change its settings and then force a re-layout to reposition the widgets at runtime.</p> <p>Eclipse's <code>SWT Layout</code> view might be of great help for you.</p> <p>Here's some code that reproduces your layout:</p> <pre><code>import org.eclipse.swt.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; public class MyLayout { public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); FormLayout formLayout = new FormLayout (); shell.setLayout (formLayout); Button button0 = new Button (shell, SWT.PUSH); button0.setText ("button0"); FormData data = new FormData (); data.left = new FormAttachment (0, 0); data.right = new FormAttachment (button1, 0, SWT.DEFAULT); button0.setLayoutData (data); Button button1 = new Button (shell, SWT.PUSH); button1.setText ("button1"); data = new FormData (); data.left = new FormAttachment (button3, 0, SWT.LEFT); data.right = new FormAttachment (button3, 0, SWT.RIGHT); button1.setLayoutData (data); Button button2 = new Button (shell, SWT.PUSH); button2.setText ("button2"); data = new FormData (); data.left = new FormAttachment (button3, 0, SWT.LEFT); data.right = new FormAttachment (button3, 0, SWT.RIGHT); data.top = new FormAttachment (button1, 0, SWT.DEFAULT); button2.setLayoutData (data); Button button3 = new Button (shell, SWT.PUSH); button3.setText ("button3"); data = new FormData (); data.right = new FormAttachment (button4, 0, SWT.DEFAULT); data.bottom = new FormAttachment (100, 0); button3.setLayoutData (data); Button button4 = new Button (shell, SWT.PUSH); button4.setText ("button4"); data = new FormData (); data.right = new FormAttachment (100, 0); data.bottom = new FormAttachment (100, 0); button4.setLayoutData (data); shell.pack (); shell.open (); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload