DhCheckBox Class

DhCheckBox Class

This Package | All Packages

DhElement
  |
  +--DhBaseContainer
    |
    +--DhCheckBox
public class DhCheckBox
extends DhBaseContainer

Represents an HTML-intrinsic check box with a text label.

Constructors
Name Description
DhCheckBox() Creates a check box.
DhCheckBox( String strText, boolean fChecked ) Creates a check box.

Methods
Name Description
getChecked() Retrieves the checked state of the check box.
getEnabled() Retrieves the enabled state of the check box.
getSubmitName( ) Retrieves the current name attribute for this check box.
getSubmitValue( ) Retrieves the submit value for this check box.
getText( ) Retrieves the current text label for the check box.
getTextAlignment() Retrieves the current alignment.
setChecked( boolean fChecked ) Sets the checked state of the check box.
setEnabled( boolean f) Sets the enabled state of the check box.
setFocus() Sets the input focus to this control
setSubmitName( String strName ) Sets the name for this check box.
setSubmitValue( String strValue ) Sets the submit value for this check box.
setText( String strText ) Sets the text label for the check box.
setTextAlignment( int newAlignment ) Sets the current alignment.

Constructors

DhCheckBox.DhCheckBox

Syntax 1
public DhCheckBox();
Description

Creates a check box. By default, this check box has neither a label nor a check mark.



Syntax 2
public DhCheckBox( String strText, boolean fChecked );
Parameters
strText
The text label.
fChecked
The initial checked state of the check box.
Description

Creates a check box. By default, this check box has a right-aligned label.

Methods

DhCheckBox.getChecked

Syntax
public boolean getChecked();
Return Value

Returns true if the box is checked; returns false if not checked.

Description

Retrieves the checked state of the check box.

DhCheckBox.getEnabled

Syntax
public boolean getEnabled();
Return Value

Returns true if the box is enabled; returns false if it is not.

Description

Retrieves the enabled state of the check box.

DhCheckBox.getSubmitName

Syntax
public String getSubmitName( );
Return Value

Returns the name attribute. This attribute is used only for HTTP form submission; otherwise, it is not required.

Description

Retrieves the current name attribute for this check box.

DhCheckBox.getSubmitValue

Syntax
public String getSubmitValue( );
Return Value

Returns the current submit value.

Description

Retrieves the submit value for this check box.

See Also
setSubmitValue

DhCheckBox.getText

Syntax
public String getText( );
Return Value

Returns the current text label.

Description

Retrieves the current text label for the check box.

DhCheckBox.getTextAlignment

Syntax
public synchronized int getTextAlignment();
Return Value

Returns the current alignment, which can be either TEXT_RIGHT or TEXT_LEFT.

Description

Retrieves the current alignment.

DhCheckBox.setChecked

Syntax
public void setChecked( boolean fChecked );
Parameters
fChecked
Set to true for a selected box; set to false for a cleared box.
Description

Sets the checked state of the check box.

DhCheckBox.setEnabled

Syntax
public void setEnabled( boolean f );
Parameters
f
Set to true to enable the check box; set to false disabled it.
Description

Sets the enabled state of the check box.

DhCheckBox.setFocus

Syntax
public void setFocus();
Description

Sets the input focus to this control

DhCheckBox.setSubmitName

Syntax
public void setSubmitName( String strName );
Parameters
strName
The name attribute. This name should be unique on the form.
Description

Sets the name for this check box. This name is used during HTTP form submission.

DhCheckBox.setSubmitValue

Syntax
public void setSubmitValue( String strValue );
Parameters
strName
The new submit value.
Description

Sets the submit value for this check box.

DhCheckBox.setText

Syntax
public void setText( String strText );
Parameters
strText
The label to display for the check box.
Description

Sets the text label for the check box. The check box can be selected or cleared by clicking this label.

DhCheckBox.setTextAlignment

Syntax
public synchronized void setTextAlignment( int newAlignment );
Parameters
newAlignment
The new alignment, which can be either TEXT_LEFT or TEXT_RIGHT.
Description

Sets the current alignment.