Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » push button on the same composite of radio group is getting focus for arrow keys(push button on the same composite of radio group is getting focus for arrow keys)
push button on the same composite of radio group is getting focus for arrow keys [message #1063079] Wed, 12 June 2013 07:48
Amaravathi Yagati is currently offline Amaravathi YagatiFriend
Messages: 5
Registered: June 2013
Junior Member
Push button with a group of radio buttons on the same composite getting focus for arrow keys which is supposed to be used for selecting an option from radio group.

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);

Button[] radioButtons = new Button[3];
radioButtons[0] = new Button(shell, SWT.RADIO);
radioButtons[0].setText("Choice 1");

radioButtons[1] = new Button(shell, SWT.RADIO);
radioButtons[1].setText("Choice 2");

radioButtons[2] = new Button(shell, SWT.RADIO);
radioButtons[2].setText("Choice 3");
Text textBox = new Text(shell, SWT.BORDER);
textBox.setLocation(260, 150);

//push button
Button pushButton = new Button(shell, SWT.PUSH);
pushButton.setLocation(100, 250);
pushButton.setText("Get Value (push button)");

shell.setSize(500,500); ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
display.dispose ();
Previous Topic:NoSuchMethodError
Next Topic:Need to click Save All twice in juno
Goto Forum:

Current Time: Mon Jun 18 13:58:27 GMT 2018

Powered by FUDForum. Page generated in 0.01338 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top