Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It doesn't appear that your snippet is complete, but a few things came to mind regarding your problem. You can probably use setEnabled as seen in the snippet below. For more advance things you could look at GridLayout and GridData with the .exclude property in conjunction with setVisible. For reference the SWT Snippets <a href="http://www.eclipse.org/swt/snippets/" rel="nofollow noreferrer">page</a> is really great.</p> <pre><code>import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; public class App2 { public static void main(final String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new GridLayout(3, false)); final Button button1 = new Button(shell, SWT.PUSH); button1.setText("Click"); final Button button2 = new Button(shell, SWT.PUSH); button2.setText("Me"); final Button button3 = new Button(shell, SWT.PUSH); button3.setText("Dude"); button1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); button2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); button3.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); button2.setEnabled(false); button3.setEnabled(false); button1.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { button1.setEnabled(false); button2.setEnabled(true); button3.setEnabled(false); } }); button2.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { button1.setEnabled(false); button2.setEnabled(false); button3.setEnabled(true); } }); button3.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { button1.setEnabled(true); button2.setEnabled(false); button3.setEnabled(false); } }); shell.open(); shell.pack(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    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. 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