1

ラジオ グループからオプションを選択するために使用される矢印キーのフォーカスを得る、同じコンポジット上のラジオ ボタンのグループを持つプッシュ ボタン。

PUSH ボタンが矢印キーにフォーカスされないようにすることはできますか。方法はありますか??

サンプル コードは次のとおりです。

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 ();
}
}
4

0 に答える 0