Results 1 to 1 of 1
Thread: How to use SWT Radio Button
-
How to use SWT Radio Button
Java Code:import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; public class MainButton { public static void main(String[] args) { final Display display = new Display(); Shell shell = new Shell(display); shell.setText("Radio Buttons"); shell.pack(); Button[] radios = new Button[3]; radios[0] = new Button(shell, SWT.RADIO); radios[0].setSelection(true); radios[0].setText("Choice 1"); radios[0].setBounds(10, 5, 75, 30); radios[1] = new Button(shell, SWT.RADIO); radios[1].setText("Choice 2"); radios[1].setBounds(10, 30, 75, 30); radios[2] = new Button(shell, SWT.RADIO); radios[2].setText("Choice 3"); radios[2].setBounds(10, 55, 75, 30); shell.open(); shell.pack(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }"The sole cause of man’s unhappiness is that he does not know how to stay quietly in his room." - Blaise Pascal
Similar Threads
-
Disable Radio button
By AJG in forum New To JavaReplies: 3Last Post: 05-10-2011, 11:09 AM -
Reacting Radio button event
By Java Tip in forum javax.swingReplies: 0Last Post: 06-26-2008, 07:46 PM -
radio buttons and paint
By gtraylo in forum Java AppletsReplies: 1Last Post: 04-19-2008, 12:43 PM -
property for radio buttons
By swapnanair in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 12-03-2007, 08:39 AM -
Radio button values are not lose
By chockalingam in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 12-03-2007, 08:14 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks