Use RadioButtonGroup : RadioButton « GWT « Java






Use RadioButtonGroup

  

package com.java2s.gwt.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.HorizontalPanel;

public class GWTClient implements EntryPoint {

  public void onModuleLoad() {
    RadioButton radio0 = new RadioButton("group0", "Choice 0");
    RadioButton radio1 = new RadioButton("group0", "Choice 1");
    RadioButton radio2 = new RadioButton("group0", "Choice 2 (Disabled)");
    RadioButton radio3 = new RadioButton("group0", "Choice 3");

    HorizontalPanel hp = new HorizontalPanel();
    hp.setSpacing(8);
    hp.add(radio0);
    hp.add(radio1);
    hp.add(radio2);
    hp.add(radio3);

    radio2.setEnabled(false);
    
    RootPanel.get().add(hp);
  }
}


           
         
    
  








GWT-radioButtonGroup.zip( 2 k)

Related examples in the same category

1.Add change listener to Radio buttons (Smart GWT)Add change listener to Radio buttons (Smart GWT)
2.Using RadioGroupItem to create radio buttons (Smart GWT)Using RadioGroupItem to create radio buttons (Smart GWT)
3.Using RadioGroup to group RedioButtons (Ext GWT)Using RadioGroup to group RedioButtons (Ext GWT)