Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumspush button on the same composite of radio group is getting focus for arrow keys
https://www.eclipse.org/forums/index.php/mv/msg/488727/1063079/#msg_1063079
can we prevent this for PUSH button from getting focused to arrow keys. Is there any way ??
Here is the sample code .
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
public class SWTButtons {
public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell(display);
//radio
Button[] radioButtons = new Button[3];
radioButtons[0] = new Button(shell, SWT.RADIO);
radioButtons[0].setSelection(true);
radioButtons[0].setText("Choice 1");
radioButtons[0].setLocation(50,150);
radioButtons[0].pack();
radioButtons[1] = new Button(shell, SWT.RADIO);
radioButtons[1].setText("Choice 2");
radioButtons[1].setLocation(120,150);
radioButtons[1].pack();
radioButtons[2] = new Button(shell, SWT.RADIO);
radioButtons[2].setText("Choice 3");
radioButtons[2].setLocation(190,150);
radioButtons[2].pack();
//Text
Text textBox = new Text(shell, SWT.BORDER);
textBox.setText("Test");
textBox.setLocation(260, 150);
textBox.pack();
//push button
Button pushButton = new Button(shell, SWT.PUSH);
pushButton.setLocation(100, 250);
pushButton.setText("Get Value (push button)");
pushButton.pack();
shell.setSize(500,500);
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
}]]>Amaravathi Yagati2013-06-12T07:48:10-00:00