1

他のラジオボタンがマークされるときに、ラジオボタンを取得してこれをマークするメソッドを作成したいと思います。これが私の気の利いたGUIの例のメニューです:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<nifty>
    <useControls filename="nifty-default-controls.xml"/>
    <useStyles filename="nifty-default-styles.xml"/>
    <screen id="ustawieniaWyswietlania" controller="PakietyPodstawowe.Kontroler.KontrolerUstawieńWyświetlania">
        <layer id="GLayer0" childLayout="center">
            <control id="r1" name="radioButtonGroup"/>
            <panel id="GPanel0" childLayout="absolute" width="100%" x="210" y="257" style="nifty-panel-simple" height="100%">
                <control name="radioButton" id="GRadioButton0" group="r1" x="193" y="236"/>
                <control name="radioButton" id="GRadioButton1" group="r1" x="327" y="244"/>
            </panel>
        </layer>
    </screen>
</nifty>

私の方法:

@NiftyEventSubscriber(pattern="GRadioButton.*")
public void setSelected(final String id, final RadioButtonStateChangedEvent event) {
        IO.drukujL(event.getRadioButton().getElement().getId());
        Element element = screen.findElementByName("GRadioButton1");
//      element.setMarkted(); this method I can't find
}

この問題は単純かもしれませんが、GRadioButton0 がマークされているときに GRadioButton1 を自動的にマークする方法がわかりません。

4

1 に答える 1