borland Packages  Class Hierarchy  jbcl.control Package  Index 

CheckboxControl component

java.lang.Object
   +----java.awt.Component
           +----java.awt.Checkbox
                   +----borland.jbcl.view.CheckboxView
                           +----borland.jbcl.control.CheckboxControl

About the CheckboxControl component

Variables  Constructors  Properties  Methods  Event Listeners

Implements AccessListener, ColumnAware, DataSetAware, NavigationListener, SingletonModel, SingletonModelListener, WritableSingletonModel, BlackBox, SingletonModelView, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener

CheckboxControl is a graphical user interface element that has a boolean state. It is designed to function similarly to java.awt.Checkbox but provides the greater flexibility of model-view composition. It can also be used as a data-aware control.

When the checked property is true, a checkmark appears in the checkbox.

To make CheckboxControl data-aware, set its dataSet and columnName properties so that it is linked to the desired column in the data set. Values in that column must denote a boolean value. If this is the case, a value that evaluates to true checks the checkbox, and a false value removes the checkmark. If the user checks the checkbox, a value that equates to true is entered in column of the active record in the data set. Unchecking the checkbox puts a value that equates to false in the data set.

CheckBoxControl inherits much of its behavior from CheckBoxView, such as the state and readOnly properties. See CheckBoxView for more information.

For an example that uses a CheckboxControl, see the project file CheckboxControlSample.jpr located in the jbuilder\samples\borland\samples\jbcl\checkboxcontrol directory of your JBuilder installation. This simple application demonstrates a CheckboxControl that can be enabled or dimmed. When disabled, it ignores all keyboard or mouse input. When enabled, it can be toggled using the CheckboxControl itself or an associated menu option. A grid displays its property settings as you change them through the UI of this application.


CheckboxControl variables

Variables implemented in java.awt.Component

CheckboxControl constructors

CheckboxControl properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in borland.jbcl.view.CheckboxView

Properties implemented in java.awt.Checkbox

Properties implemented in java.awt.Component

Properties implemented in java.lang.Object

CheckboxControl methods

Methods implemented in this class

Methods implemented in borland.jbcl.view.CheckboxView

Methods implemented in java.awt.Checkbox

Methods implemented in java.awt.Component

Methods implemented in java.lang.Object

CheckboxControl event listeners


CheckboxControl constructors

CheckboxControl()

  public CheckboxControl()

Constructs a CheckboxControl with default property values.


CheckboxControl properties

checked

 public boolean isChecked()
 public void setChecked(boolean value)

Stores whether the checkbox is set (rather than cleared).

columnName

 public String getColumnName()
 public void setColumnName(java.lang.String newColumnName)

The DataSet column to which the checkbox control is bound.

dataSet

 public DataSet getDataSet()
 public void setDataSet(borland.jbcl.dataset.DataSet newDataSet)

The dataSet property specifies a borland.jbcl.dataset.DataSet object to display data from in the field.

model

 public void setModel(borland.jbcl.model.SingletonModel sm)

Does exception checking to prevent recursive model declaration. Overrides and calls borland.jbcl.view.CheckboxView.setModel(SingletonModel p), which specifies the model object that contains the component's data item.


CheckboxControl methods

addNotify()

  public void addNotify()

Creates the peer of the checkbox, so the checkbox has the standard appearance for each platform. Also, if the dataSet property is set, and that cursor's autoOpen property is set to true, opens the cursor.

Overrides: java.awt.Checkbox.addNotify()


CheckboxControl event listeners

This component is a source for the following event sets. For information on the standard AWT event sets, see Standard Java events. For information on the JBCL event sets, see Events in JBCL.

component

 public synchronized void addComponentListener(java.awt.event.ComponentListener )
 public synchronized void removeComponentListener(java.awt.event.ComponentListener )

focus

 public synchronized void addFocusListener(java.awt.event.FocusListener )
 public synchronized void removeFocusListener(java.awt.event.FocusListener )

item

 public synchronized void addItemListener(java.awt.event.ItemListener )
 public synchronized void removeItemListener(java.awt.event.ItemListener )

key

 public synchronized void addKeyListener(java.awt.event.KeyListener )
 public synchronized void removeKeyListener(java.awt.event.KeyListener )

model

 public void addModelListener(borland.jbcl.model.SingletonModelListener l)
 public void removeModelListener(borland.jbcl.model.SingletonModelListener l)

mouse

 public synchronized void addMouseListener(java.awt.event.MouseListener )
 public synchronized void removeMouseListener(java.awt.event.MouseListener )

mouseMotion

 public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener )
 public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )