java - Need 2 radio button but each of them in different Composite group in SWT -
i need 2 radio button each of them in different composite group in swt. need single selection among them. please me code. (need without using swing buttongroup)
shell shell = new shell(display); default = new group(shell,swt.radio); default.settext("default"); default.setlayout(new rowlayout(swt.horizontal)); compbutton = new button(default,swt.radio); compbutton.settext("play against computer"); pl2button = new button(shell,swt.radio); pl2button.settext("player1 vs player2");
when try select radio button, both selected.i need 1 of them selected.
you can follow below approach if don't want use buttongroup
- add selection action listener (
button.addselectionlistener
) both buttons - in action listener of first button, clear second button
- similarly in action listener of second button, clear first button
Comments
Post a Comment