public static void main(String[] args) { final Display display = new Display(); Shell shell = new Shell(display); shell.setText("Radio Buttons"); shell.pack();
final Label label = new Label(shell, SWT.NONE); label.setText("Which programming language you like most"); label.setBounds(10, 5, 170, 30); final Button radioButton1 = new Button(shell, SWT.RADIO); radioButton1.setText("Java"); radioButton1.setBounds(10, 30, 75, 30);
final Button radioButton2 = new Button(shell, SWT.RADIO); radioButton2.setText("C/C++"); radioButton2.setBounds(10, 55, 75, 30);
final Button radioButton3 = new Button(shell, SWT.RADIO); radioButton3.setText(".NET"); radioButton3.setBounds(10, 80, 75, 30);
final Button radioButton4 = new Button(shell, SWT.RADIO); radioButton4.setText("PHP"); radioButton4.setBounds(10, 105, 75, 30);
shell.open(); shell.pack(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
View All Comments
| View Tutorial