|
|
||||||||||||||||||||||||||||
Class UIRadioGrouppublic class UIRadioGroup extends UICheckGroup { // Constructors public UIRadioGroup(); public UIRadioGroup(String label); public UIRadioGroup(IUIComponent header); // Methods public IUIComponent add(IUIComponent comp, Object constraints, int index); public IUIComponent add(String name, Object constraints, int index); public boolean handleEvent(Event e); } This class implements a group box control for a list of UIRadioButton objects. This class is very similar to the java.awt.CheckboxGroup class. The group box control contains a list of radio buttons, where only one radio button can be selected at a time. Note The default layout manager for the UIRadioGroup class is the UIVerticalFlowLayout manager, so the constraints parameters of any methods that accept them are typically ignored. A UIRadioGroup object can be created in several ways. The following example shows you how to create a radio group box and add UIRadioButton objects to it. // Create an empty UIRadioGroup control // and use the UIGroup.html.setName method inherited from // UIGroup.htmlto set the label of the control. UIRadioGroup uirg1 = new UIRadioGroup(); uirg1.setName("Options"); // Add buttons to the control with the add methods. // You can add buttons in several different ways. Add the first // button by supplying a String for the button's name. uirg1.add("UIRadioButton1", null, 0); // Add the second button by first creating a UIRadioButton, // and then adding it with the add method. UIRadioButton uirb = new UIRadioButton("UIRadioButton2"); uirg1.add(uirb, null, 1); // Add the third button by supplying a component that can be // used as the label for the UIRadioButton. UIText uit = new UIText("UIRadioButton3", UIStatic.HOT); uirg1.add(uit, null, 2); The result is a group of three UIRadioButton objects contained in a UIRadioGroup control with an Options label. Note The hot-track color is the same color as the button text color. As a result, hot-tracking does not appear to be functional. UIComponent | +--UIContainer | +--UIStateContainer | +--UIPanel | +--UIGroup | +--UICheckGroup | +--UIRadioGroup ConstructorsUIRadioGrouppublic UIRadioGroup(); UIRadioGrouppublic UIRadioGroup(String label); UIRadioGrouppublic UIRadioGroup(IUIComponent header); Methodsaddpublic IUIComponent add(IUIComponent comp, Object constraints, int index); addpublic IUIComponent add(String name, Object constraints, int index); handleEventpublic boolean handleEvent(Event e);
|
© 1998 Microsoft Corporation. All rights reserved. Terms of use. |