charvax.swing
Class JRadioButton

java.lang.Object
  extended bycharva.awt.Component
      extended bycharvax.swing.JComponent
          extended bycharvax.swing.AbstractButton
              extended bycharvax.swing.JRadioButton
All Implemented Interfaces:
EventListener, ItemSelectable, KeyListener

public class JRadioButton
extends AbstractButton

An implementation of a radiobutton - an item that is always in one of two states (SELECTED or DESELECTED) and which displays its state to the user. JRadioButtons are used with a ButtonGroup object to create a group of buttons in which only one button at a time can be selected (Create a ButtonGroup object and use its add() method to add the radio buttons to it).


Field Summary
 
Fields inherited from class charvax.swing.AbstractButton
_actionListeners, _itemListeners
 
Fields inherited from class charvax.swing.JComponent
_border
 
Fields inherited from class charva.awt.Component
_alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
JRadioButton()
          Create a new JRadioButton with an empty label.
JRadioButton(java.lang.String text_)
          Use this constructor when you want to initialize the value.
JRadioButton(java.lang.String label_, boolean value_)
          Use this constructor when you want to set both the label and the value.
 
Method Summary
 void debug(int level_)
           
 void draw()
          Called by this JRadioButton's parent container.
 int getHeight()
           
 Dimension getSize()
          Return the size of the text field.
 int getWidth()
           
 Dimension minimumSize()
          Called by the LayoutManager.
 void processKeyEvent(KeyEvent ke_)
          Invoke all the KeyListener callbacks that may have been registered for this component.
 void requestFocus()
          This method should be invoked by all subclasses of Component which override this method; because this method generates the FOCUS_GAINED event when the component gains the keyboard focus.
 java.lang.String toString()
           
 
Methods inherited from class charvax.swing.AbstractButton
addActionListener, addItemListener, doClick, fireActionPerformed, fireItemStateChanged, getActionCommand, getLabel, getLabelString, getMnemonic, getText, isSelected, keyPressed, keyReleased, keyTyped, processEvent, processMouseEvent, removeItemListener, setActionCommand, setLabel, setMnemonic, setSelected, setText
 
Methods inherited from class charvax.swing.JComponent
getBorder, getInsets, setBorder
 
Methods inherited from class charva.awt.Component
addFocusListener, addKeyListener, contains, contains, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getLocation, getLocationOnScreen, getName, getParent, hasFocus, hide, invalidate, isDisplayed, isEnabled, isFocusTraversable, isTotallyObscured, isValid, isVisible, processFocusEvent, repaint, requestSync, setBackground, setBounds, setBounds, setBounds, setEnabled, setForeground, setLocation, setLocation, setName, setParent, setVisible, show, validate, validateCursesColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JRadioButton

public JRadioButton()
Create a new JRadioButton with an empty label.


JRadioButton

public JRadioButton(java.lang.String text_)
Use this constructor when you want to initialize the value.


JRadioButton

public JRadioButton(java.lang.String label_,
                    boolean value_)
Use this constructor when you want to set both the label and the value.

Method Detail

getSize

public Dimension getSize()
Return the size of the text field. Overrides the method in the Component superclass.

Specified by:
getSize in class Component

getWidth

public int getWidth()
Specified by:
getWidth in class Component

getHeight

public int getHeight()
Specified by:
getHeight in class Component

minimumSize

public Dimension minimumSize()
Called by the LayoutManager.

Specified by:
minimumSize in class Component

draw

public void draw()
Called by this JRadioButton's parent container.

Overrides:
draw in class JComponent

processKeyEvent

public void processKeyEvent(KeyEvent ke_)
Description copied from class: Component
Invoke all the KeyListener callbacks that may have been registered for this component. The KeyListener objects may modify the keycodes, and can also set the "consumed" flag.

Overrides:
processKeyEvent in class Component

requestFocus

public void requestFocus()
Description copied from class: Component
This method should be invoked by all subclasses of Component which override this method; because this method generates the FOCUS_GAINED event when the component gains the keyboard focus.

Overrides:
requestFocus in class Component

toString

public java.lang.String toString()

debug

public void debug(int level_)
Specified by:
debug in class Component